977
977
self.assertEqual(repo.bzrdir.root_transport.base,
978
978
found_repo.bzrdir.root_transport.base)
980
def test_can_and_needs_upgrade_format(self):
980
def test_can_and_needs_format_conversion(self):
981
981
# check that we can ask an instance if its upgradable
982
982
dir = self.make_bzrdir('.')
983
if dir.can_update_format():
983
if dir.can_convert_format():
984
984
# if its updatable there must be an updater
985
self.assertTrue(isinstance(dir._format.get_updater(),
985
self.assertTrue(isinstance(dir._format.get_converter(),
986
986
bzrdir.Converter))
987
dir.needs_format_update(None)
987
dir.needs_format_conversion(None)
989
989
def test_upgrade_new_instance(self):
990
990
"""Does an available updater work ?."""
991
991
dir = self.make_bzrdir('.')
992
if dir.can_update_format():
993
dir._format.get_updater(None).convert(dir, ui.ui_factory.progress_bar())
992
if dir.can_convert_format():
993
dir._format.get_converter(None).convert(dir, ui.ui_factory.progress_bar())
994
994
# and it should pass 'check' now.
995
995
check(bzrdir.BzrDir.open(self.get_url('.')).open_branch(), False)