1
# Copyright (C) 2005-2012, 2016 Canonical Ltd
1
# Copyright (C) 2005-2011 Canonical Ltd
2
2
# Authors: Robert Collins <robert.collins@canonical.com>
4
4
# This program is free software; you can redistribute it and/or modify
186
186
transport.put_bytes("format", "some format name")
187
187
# The format does not have to be known by Bazaar,
188
188
# find_format_string just retrieves the name
189
self.assertEqual("some format name",
189
self.assertEquals("some format name",
190
190
workingtree.WorkingTreeFormatMetaDir.find_format_string(branch.bzrdir))
192
192
def test_find_format(self):
224
224
found_format = workingtree.WorkingTreeFormatMetaDir.find_format(
226
226
self.assertIsInstance(found_format, workingtree.WorkingTreeFormat)
227
self.assertEqual(found_format.features.get("name"), "necessity")
227
self.assertEquals(found_format.features.get("name"), "necessity")
228
228
self.assertRaises(errors.MissingFeature, found_format.check_support_status,
230
230
self.addCleanup(workingtree.WorkingTreeFormatMetaDir.unregister_feature,
283
283
def test_register_unregister_format(self):
284
284
format = SampleTreeFormat()
285
285
self.registry.register(format)
286
self.assertEqual(format, self.registry.get("Sample tree format."))
286
self.assertEquals(format, self.registry.get("Sample tree format."))
287
287
self.registry.remove(format)
288
288
self.assertRaises(KeyError, self.registry.get, "Sample tree format.")
290
290
def test_get_all(self):
291
291
format = SampleTreeFormat()
292
self.assertEqual([], self.registry._get_all())
292
self.assertEquals([], self.registry._get_all())
293
293
self.registry.register(format)
294
self.assertEqual([format], self.registry._get_all())
294
self.assertEquals([format], self.registry._get_all())
296
296
def test_register_extra(self):
297
297
format = SampleExtraTreeFormat()
298
self.assertEqual([], self.registry._get_all())
298
self.assertEquals([], self.registry._get_all())
299
299
self.registry.register_extra(format)
300
self.assertEqual([format], self.registry._get_all())
300
self.assertEquals([format], self.registry._get_all())
302
302
def test_register_extra_lazy(self):
303
self.assertEqual([], self.registry._get_all())
303
self.assertEquals([], self.registry._get_all())
304
304
self.registry.register_extra_lazy("bzrlib.tests.test_workingtree",
305
305
"SampleExtraTreeFormat")
306
306
formats = self.registry._get_all()
307
self.assertEqual(1, len(formats))
307
self.assertEquals(1, len(formats))
308
308
self.assertIsInstance(formats[0], SampleExtraTreeFormat)
356
356
self.assertIsDirectory('.bzr/checkout', t)
357
357
self.assertIsDirectory('.bzr/checkout/lock', t)
358
358
our_lock = LockDir(t, '.bzr/checkout/lock')
359
self.assertEqual(our_lock.peek(), None)
359
self.assertEquals(our_lock.peek(), None)
360
360
tree.lock_write()
361
361
self.assertTrue(our_lock.peek())
363
self.assertEqual(our_lock.peek(), None)
363
self.assertEquals(our_lock.peek(), None)
365
365
def test_missing_pending_merges(self):
366
366
control = bzrdir.BzrDirMetaFormat1().initialize(self.get_url())