1
# Copyright (C) 2005-2011 Canonical Ltd
1
# Copyright (C) 2005-2012, 2016 Canonical Ltd
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
364
364
def test_as_tree(self):
365
365
tree = self.get_as_tree('0')
366
self.assertEquals(_mod_revision.NULL_REVISION, tree.get_revision_id())
366
self.assertEqual(_mod_revision.NULL_REVISION, tree.get_revision_id())
367
367
tree = self.get_as_tree('1')
368
self.assertEquals('r1', tree.get_revision_id())
368
self.assertEqual('r1', tree.get_revision_id())
369
369
tree = self.get_as_tree('2')
370
self.assertEquals('r2', tree.get_revision_id())
370
self.assertEqual('r2', tree.get_revision_id())
371
371
tree = self.get_as_tree('-2')
372
self.assertEquals('r1', tree.get_revision_id())
372
self.assertEqual('r1', tree.get_revision_id())
373
373
tree = self.get_as_tree('-1')
374
self.assertEquals('r2', tree.get_revision_id())
374
self.assertEqual('r2', tree.get_revision_id())
375
375
tree = self.get_as_tree('1.1.1')
376
self.assertEquals('alt_r2', tree.get_revision_id())
376
self.assertEqual('alt_r2', tree.get_revision_id())
379
379
class TestRevisionSpec_revid(TestRevisionSpec):
657
657
def test_as_tree(self):
658
658
tree = self.get_as_tree('branch:tree', self.tree2)
659
self.assertEquals('r2', tree.get_revision_id())
659
self.assertEqual('r2', tree.get_revision_id())
660
660
self.assertFalse(self.tree2.branch.repository.has_revision('r2'))