~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_revisiontree.py

  • Committer: Vincent Ladeuil
  • Date: 2016-01-21 17:48:07 UTC
  • mto: This revision was merged to the branch mainline in revision 6613.
  • Revision ID: v.ladeuil+lp@free.fr-20160121174807-g4ybpaij9ln5wj6a
Make all transport put_bytes() raises TypeError when given unicode strings rather than bytes.

There was a mix of AssertionError or UnicodeEncodeError.

Also deleted test_put_file_unicode() which was bogus, files contain bytes not unicode strings.

Show diffs side-by-side

added added

removed removed

Lines of Context:
58
58
    def test_empty_no_root(self):
59
59
        null_tree = self.t.branch.repository.revision_tree(
60
60
            revision.NULL_REVISION)
61
 
        self.assertIs(None, null_tree.inventory.root)
62
61
        self.assertIs(None, null_tree.get_root_id())
63
62
 
64
63
    def test_get_file_revision_root(self):
76
75
 
77
76
    def test_get_file_mtime_ghost(self):
78
77
        file_id = iter(self.rev_tree.all_file_ids()).next()
79
 
        self.rev_tree.inventory[file_id].revision = 'ghostrev'
 
78
        self.rev_tree.root_inventory[file_id].revision = 'ghostrev'
80
79
        self.assertRaises(errors.FileTimestampUnavailable, 
81
80
            self.rev_tree.get_file_mtime, file_id)