/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 breezy/tests/per_workingtree/test_workingtree.py

  • Committer: Jelmer Vernooij
  • Date: 2017-11-12 20:07:32 UTC
  • mto: This revision was merged to the branch mainline in revision 6819.
  • Revision ID: jelmer@jelmer.uk-20171112200732-ehxgen03s9jphe8n
Swap arguments for get_symlink_target and kind/stored_kind.

Show diffs side-by-side

added added

removed removed

Lines of Context:
912
912
        if has_symlinks():
913
913
            os.symlink('target', 'symlink')
914
914
            names.append('symlink')
915
 
        tree.add(names, [n + '-id' for n in names])
 
915
        tree.add(names)
916
916
        # now when we first look, we should see everything with the same kind
917
917
        # with which they were initially added
918
918
        for n in names:
919
 
            actual_kind = tree.kind(n + '-id')
 
919
            actual_kind = tree.kind(n)
920
920
            self.assertEqual(n, actual_kind)
921
921
        # move them around so the names no longer correspond to the types
922
922
        os.rename(names[0], 'tmp')
925
925
        os.rename('tmp', names[-1])
926
926
        # now look and expect to see the correct types again
927
927
        for i in range(len(names)):
928
 
            actual_kind = tree.kind(names[i-1] + '-id')
 
928
            actual_kind = tree.kind(names[i-1])
929
929
            expected_kind = names[i]
930
930
            self.assertEqual(expected_kind, actual_kind)
931
931
 
937
937
        tree.add(['a', 'b'])
938
938
        os.unlink('tree/a')
939
939
        os.rmdir('tree/b')
940
 
        self.assertEqual('file', tree.stored_kind(tree.path2id('a')))
941
 
        self.assertEqual('directory', tree.stored_kind(tree.path2id('b')))
 
940
        self.assertEqual('file', tree.stored_kind('a'))
 
941
        self.assertEqual('directory', tree.stored_kind('b'))
942
942
 
943
943
    def test_missing_file_sha1(self):
944
944
        """If a file is missing, its sha1 should be reported as None."""