~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-31 05:54:21 UTC
  • mfrom: (2743.3.6 bzr.quicker-initial-commit)
  • mto: This revision was merged to the branch mainline in revision 2774.
  • Revision ID: ian.clatworthy@internode.on.net-20070831055421-iwcem9phv1needkk
(Ian Clatworthy) Quicker initial commit - skip SHAing twice & skip path lookup as we know it

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):