~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/tree_implementations/test_tree.py

  • Committer: Aaron Bentley
  • Date: 2007-09-02 22:38:54 UTC
  • mfrom: (2776 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2777.
  • Revision ID: aaron.bentley@utoronto.ca-20070902223854-vh6jc4c19w94htsm
Merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
122
122
            tree.unlock()
123
123
 
124
124
 
 
125
class TestFileContent(TestCaseWithTree):
 
126
 
 
127
    def test_get_file(self):
 
128
        work_tree = self.make_branch_and_tree('wt')
 
129
        tree = self.get_tree_no_parents_abc_content_2(work_tree)
 
130
        tree.lock_read()
 
131
        try:
 
132
            # Test lookup without path works
 
133
            lines = tree.get_file('a-id').readlines()
 
134
            self.assertEqual(['foobar\n'], lines)
 
135
            # Test lookup with path works
 
136
            lines = tree.get_file('a-id', path='a').readlines()
 
137
            self.assertEqual(['foobar\n'], lines)
 
138
        finally:
 
139
            tree.unlock()
 
140
 
 
141
 
125
142
class TestExtractFilesBytes(TestCaseWithTree):
126
143
 
127
144
    def test_iter_files_bytes(self):