~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Ian Clatworthy
  • Date: 2007-08-30 02:00:37 UTC
  • mto: (2772.2.1 ianc-integration)
  • mto: This revision was merged to the branch mainline in revision 2774.
  • Revision ID: ian.clatworthy@internode.on.net-20070830020037-lvqrgnm7lbmmcl8y
Incorporate feedback from abentley

Show diffs side-by-side

added added

removed removed

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