353
353
plugin = bzrlib.plugin.plugins()['plugin']
354
354
self.assertEqual("unknown", plugin.__version__)
356
def test___version__with_version_info_1_2(self):
356
def test_str__version__with_version_info(self):
357
self.setup_plugin("version_info = '1.2.3'")
358
plugin = bzrlib.plugin.plugins()['plugin']
359
self.assertEqual("1.2.3", plugin.__version__)
361
def test_noniterable__version__with_version_info(self):
362
self.setup_plugin("version_info = (1)")
363
plugin = bzrlib.plugin.plugins()['plugin']
364
self.assertEqual("1", plugin.__version__)
366
def test_1__version__with_version_info(self):
367
self.setup_plugin("version_info = (1,)")
368
plugin = bzrlib.plugin.plugins()['plugin']
369
self.assertEqual("1", plugin.__version__)
371
def test_1_2__version__with_version_info(self):
357
372
self.setup_plugin("version_info = (1, 2)")
358
373
plugin = bzrlib.plugin.plugins()['plugin']
359
374
self.assertEqual("1.2", plugin.__version__)
361
def test___version__with_version_info_1_2_3(self):
376
def test_1_2_3__version__with_version_info(self):
362
377
self.setup_plugin("version_info = (1, 2, 3)")
363
378
plugin = bzrlib.plugin.plugins()['plugin']
364
379
self.assertEqual("1.2.3", plugin.__version__)
373
388
plugin = bzrlib.plugin.plugins()['plugin']
374
389
self.assertEqual("1.2.3dev", plugin.__version__)
391
def test_dev_fallback__version__with_version_info(self):
392
self.setup_plugin("version_info = (1, 2, 3, 'dev', 4)")
393
plugin = bzrlib.plugin.plugins()['plugin']
394
self.assertEqual("1.2.3.dev.4", plugin.__version__)
376
396
def test_final__version__with_version_info(self):
377
397
self.setup_plugin("version_info = (1, 2, 3, 'final', 0)")
378
398
plugin = bzrlib.plugin.plugins()['plugin']