def test_bad_config_file(self): with io.open(self.NOT_A_DICT, encoding='utf-8') as yamlfile: conf._flags.config_file = yamlfile with self.assertRaises(conf.ConfigurationInvalidError): conf.reset() with io.open(self.BAD_FORMAT, encoding='utf-8') as yamlfile: conf._flags.config_file = yamlfile with self.assertRaises(conf.ConfigurationInvalidError): conf.reset()
def test_bad_config_file(self): with open(self.NOT_A_DICT, 'rb') as yamlfile: conf._flags.config_file = yamlfile with self.assertRaises(conf.ConfigurationInvalidError): conf.reset() with open(self.BAD_FORMAT, 'rb') as yamlfile: conf._flags.config_file = yamlfile with self.assertRaises(conf.ConfigurationInvalidError): conf.reset()
def test_yaml_config(self): with io.open(self.YAML_FILENAME, encoding='utf-8') as yamlfile: conf._flags.config_file = yamlfile conf.reset() self.assertEqual('yaml_test_value', conf.yaml_test_key)
def tearDown(self): conf._flags.config_file = None conf.reset()
def test_yaml_config(self): with open(self.YAML_FILENAME, 'rb') as yamlfile: conf._flags.config_file = yamlfile conf.reset() self.assertEquals('yaml_test_value', conf.yaml_test_key)
def test_yaml_config(self): with open(self.YAML_FILENAME, 'rb') as yamlfile: conf._flags.config_file = yamlfile conf.reset() self.assertEqual('yaml_test_value', conf.yaml_test_key)
def tearDown(self): conf._flags.config_file = None conf.reset() super(TestConf, self).tearDown()