mirror of
https://github.com/github/octodns.git
synced 2024-05-11 05:55:00 +00:00
Manager._try_version with 3.7 noop (for now)
This commit is contained in:
@@ -8,6 +8,7 @@ from __future__ import absolute_import, division, print_function, \
|
||||
from os import environ
|
||||
from os.path import dirname, join
|
||||
|
||||
from octodns import __VERSION__
|
||||
from octodns.manager import _AggregateTarget, MainThreadExecutor, Manager, \
|
||||
ManagerException
|
||||
from octodns.processor.base import BaseProcessor
|
||||
@@ -524,6 +525,29 @@ class TestManager(TestCase):
|
||||
# no plans
|
||||
self.assertFalse(plans)
|
||||
|
||||
def test_try_version(self):
|
||||
manager = Manager(get_config_filename('simple.yaml'))
|
||||
|
||||
class DummyModule(object):
|
||||
__VERSION__ = '2.3.4'
|
||||
|
||||
dummy_module = DummyModule()
|
||||
|
||||
# use importlib.metadata.version
|
||||
self.assertTrue(__VERSION__,
|
||||
manager._try_version('octodns',
|
||||
module=dummy_module,
|
||||
version='1.2.3'))
|
||||
|
||||
# use module
|
||||
self.assertTrue(manager._try_version('doesnt-exist',
|
||||
module=dummy_module))
|
||||
|
||||
# fall back to version, preferred over module
|
||||
self.assertEqual('1.2.3', manager._try_version('doesnt-exist',
|
||||
module=dummy_module,
|
||||
version='1.2.3', ))
|
||||
|
||||
|
||||
class TestMainThreadExecutor(TestCase):
|
||||
|
||||
|
||||
Reference in New Issue
Block a user