~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_plugins.py

  • Committer: Marius Kruger
  • Date: 2008-10-16 09:16:48 UTC
  • mto: This revision was merged to the branch mainline in revision 3821.
  • Revision ID: amanic@gmail.com-20081016091648-mv0bz3x9ti4d2rw8
* Can now also handle non-iteratable and string plugin versions.
* Add some more tests.

Show diffs side-by-side

added added

removed removed

Lines of Context:
353
353
        plugin = bzrlib.plugin.plugins()['plugin']
354
354
        self.assertEqual("unknown", plugin.__version__)
355
355
 
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__)
 
360
 
 
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__)
 
365
 
 
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__)
 
370
 
 
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__)
360
375
 
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__)
375
390
 
 
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__)
 
395
 
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']