def setup_container(self): other_config = TestNamedConfig.config self.config_mapping = { MASTER_NAMESPACE: valid_config(self.config), 'other': validate_fragment('other', other_config), } self.container = config_parse.ConfigContainer(self.config_mapping)
def setup_container(self): other_config = yaml.load(NamedConfigTestCase.config) self.config_mapping = { MASTER_NAMESPACE: valid_config(yaml.load(self.config)), 'other': validate_fragment('other', other_config) } self.container = config_parse.ConfigContainer(self.config_mapping)
def test_attributes(self): config_parse.ValidateNode.defaults['username'] = '******' expected = make_tron_config() test_config = valid_config(self.config) assert test_config.command_context == expected.command_context assert test_config.ssh_options == expected.ssh_options assert test_config.mesos_options == expected.mesos_options assert test_config.time_zone == expected.time_zone assert test_config.nodes == expected.nodes assert test_config.node_pools == expected.node_pools for key in ['0', '1', '2', '_actions_dict', '4', '_mesos']: job_name = f"MASTER.test_job{key}" assert job_name in test_config.jobs, f"{job_name} in test_config.jobs" assert job_name in expected.jobs, f"{job_name} in test_config.jobs" assert test_config.jobs[job_name] == expected.jobs[job_name] assert test_config == expected
def test_empty_node_test(self): valid_config(dict(nodes=None))
def valid_config_from_yaml(config_content): return valid_config(manager.from_string(config_content))
def setup_container(self): other_config = yaml.load(NamedConfigTestCase.config) self.config_mapping = { MASTER_NAMESPACE: valid_config(yaml.load(self.config)), 'other': validate_fragment('other', other_config)} self.container = config_parse.ConfigContainer(self.config_mapping)