b.t.p.t.TestHasSameLocation(TestCaseWithRepository) : class documentation

Part of bzrlib.tests.per_repository.test_has_same_location View In Hierarchy

Tests for Repository.has_same_location method.
Method assertSameRepo Asserts that two objects are the same repository.
Method assertDifferentRepo Asserts that two objects are the not same repository.
Method test_same_repo_instance A repository object is the same repository as itself.
Method test_same_repo_location Different repository objects for the same location are the same.
Method test_different_repos_not_equal Repositories at different locations are not the same.
Method test_same_bzrdir_different_control_files_not_equal Repositories in the same bzrdir, but with different control files,
Method test_different_format_not_equal Different format repositories are comparable and not the same.

Inherited from TestCaseWithRepository:

Method get_default_format Undocumented
Method make_repository Undocumented
def assertSameRepo(self, a, b):
Asserts that two objects are the same repository.

This method does the comparison both ways (a.has_same_location(b) as well as b.has_same_location(a)) to make sure both objects' has_same_location methods give the same results.

def assertDifferentRepo(self, a, b):
Asserts that two objects are the not same repository.

This method does the comparison both ways (a.has_same_location(b) as well as b.has_same_location(a)) to make sure both objects' has_same_location methods give the same results.

See AlsoassertDifferentRepo
def test_same_repo_instance(self):
A repository object is the same repository as itself.
def test_same_repo_location(self):
Different repository objects for the same location are the same.
def test_different_repos_not_equal(self):
Repositories at different locations are not the same.
def test_same_bzrdir_different_control_files_not_equal(self):
Repositories in the same bzrdir, but with different control files, are not the same.

This can happens e.g. when upgrading a repository. This test mimics how CopyConverter creates a second repository in one bzrdir.

def test_different_format_not_equal(self):
Different format repositories are comparable and not the same.

Comparing different format repository objects should give a negative result, rather than trigger an exception (which could happen with a naive __eq__ implementation, e.g. due to missing attributes).

API Documentation for Bazaar, generated by pydoctor at 2022-01-20 00:34:26.