mirror of
https://github.com/lilydjwg/nvchecker
synced 2024-12-29 10:02:09 +00:00
test helper: generate a real ConfigParser to make all its methods available
This commit is contained in:
parent
d909983f0d
commit
5db3b93dcd
@ -1,3 +1,4 @@
|
||||
import configparser
|
||||
from tornado.ioloop import IOLoop
|
||||
import tornado.testing
|
||||
from nvchecker.get_version import get_version
|
||||
@ -11,5 +12,12 @@ class ExternalVersionTestCase(tornado.testing.AsyncTestCase):
|
||||
def get_version_callback(name, version):
|
||||
self.stop(version)
|
||||
|
||||
get_version(name, config, get_version_callback)
|
||||
if isinstance(config, dict):
|
||||
_config = configparser.ConfigParser(dict_type=dict, allow_no_value=True)
|
||||
_config.read_dict({name: config})
|
||||
_config = _config[name]
|
||||
else:
|
||||
_config = config
|
||||
|
||||
get_version(name, _config, get_version_callback)
|
||||
return self.wait()
|
||||
|
Loading…
Reference in New Issue
Block a user