/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/workingtree_implementations/test_workingtree.py

Merge bzr.dev r3466

Show diffs side-by-side

added added

removed removed

Lines of Context:
579
579
        # FIXME: This doesn't really test that it works; also this is not
580
580
        # implementation-independent. mbp 20070226
581
581
        tree = self.make_branch_and_tree('master')
582
 
        tree._control_files.put('merge-hashes', StringIO('asdfasdf'))
 
582
        tree._transport.put_bytes('merge-hashes', 'asdfasdf')
583
583
        self.assertRaises(errors.MergeModifiedFormatError, tree.merge_modified)
584
584
 
585
585
    def test_merge_modified(self):
608
608
            
609
609
        tree2 = WorkingTree.open('master')
610
610
        self.assertEqual(tree2.conflicts(), example_conflicts)
611
 
        tree2._control_files.put('conflicts', StringIO(''))
612
 
        self.assertRaises(errors.ConflictFormatError, 
 
611
        tree2._transport.put_bytes('conflicts', '')
 
612
        self.assertRaises(errors.ConflictFormatError,
613
613
                          tree2.conflicts)
614
 
        tree2._control_files.put('conflicts', StringIO('a'))
615
 
        self.assertRaises(errors.ConflictFormatError, 
 
614
        tree2._transport.put_bytes('conflicts', 'a')
 
615
        self.assertRaises(errors.ConflictFormatError,
616
616
                          tree2.conflicts)
617
617
 
618
618
    def make_merge_conflicts(self):
826
826
            expected_kind = names[i]
827
827
            self.assertEqual(expected_kind, actual_kind)
828
828
 
 
829
    def test_stored_kind_with_missing(self):
 
830
        tree = self.make_branch_and_tree('tree')
 
831
        tree.lock_write()
 
832
        self.addCleanup(tree.unlock)
 
833
        self.build_tree(['tree/a', 'tree/b/'])
 
834
        tree.add(['a', 'b'], ['a-id', 'b-id'])
 
835
        os.unlink('tree/a')
 
836
        os.rmdir('tree/b')
 
837
        self.assertEqual('file', tree.stored_kind('a-id'))
 
838
        self.assertEqual('directory', tree.stored_kind('b-id'))
 
839
 
829
840
    def test_missing_file_sha1(self):
830
841
        """If a file is missing, its sha1 should be reported as None."""
831
842
        tree = self.make_branch_and_tree('.')
865
876
            raise TestSkipped('WorkingTree2 is not supported')
866
877
        self.assertEqual(case_sensitive, tree.case_sensitive)
867
878
 
 
879
    def test_all_file_ids_with_missing(self):
 
880
        tree = self.make_branch_and_tree('tree')
 
881
        tree.lock_write()
 
882
        self.addCleanup(tree.unlock)
 
883
        self.build_tree(['tree/a', 'tree/b'])
 
884
        tree.add(['a', 'b'], ['a-id', 'b-id'])
 
885
        os.unlink('tree/a')
 
886
        self.assertEqual(set(['a-id', 'b-id', tree.get_root_id()]),
 
887
                         tree.all_file_ids())
 
888
 
868
889
    def test_sprout_hardlink(self):
869
890
        source = self.make_branch_and_tree('source')
870
891
        self.build_tree(['source/file'])