def test_omartestpy4_default_version(self, *args, **kwargs): QubeConfig.get_config().QUBE_VERSION_FILE = resource_filename( 'qube.src.resources', 'qube_sample_version_dontexist.txt') QubeConfig.get_config().version_str = None rv = self.test_client.get(HELLO_VERSION, headers=[('Content-Type', 'application/json')]) result = json.loads(rv.data.decode('utf-8')) self.assertTrue(rv._status_code == 200) self.assertEquals(result['version'], QubeConfig.get_config().default_ver)
def test_omartestpy4_git_version(self, *args, **kwargs): QubeConfig.get_config().QUBE_VERSION_FILE = resource_filename( 'qube.src.resources', 'qube_sample_version.txt') QubeConfig.get_config().version_str = None with open(QubeConfig.get_config().QUBE_VERSION_FILE, 'r') as f: expected_version_str_file = f.read() expected_version_string = "{} ({})". \ format(QubeConfig.get_config().default_ver, expected_version_str_file.strip()) rv = self.test_client.get(HELLO_VERSION, headers=[('Content-Type', 'application/json')]) result = json.loads(rv.data.decode('utf-8')) self.assertTrue(rv._status_code == 200) self.assertEquals(result['version'], expected_version_string)
def __init__(self, *args, **kwargs): super(jeff2ItemVersionController, self).__init__(*args, **kwargs) self.config = QubeConfig.get_config()