def environment_test(self, filename): config = Config('') config.from_toml(filename, environment='dev') assert config['TEST_KEY'] == 'foo' assert config['SECRET_KEY'] == 'devkey' assert config['DEBUG'] == True assert 'TESTING' not in config assert 'ignored' not in config config = Config('') config.from_toml(filename, environment='testing') assert config['TEST_KEY'] == 'foo' assert config['SECRET_KEY'] == 'devkey' assert config['TESTING'] == True assert 'DEBUG' not in config assert 'ignored' not in config
def test_toml_advanced(self): config = Config('') config.from_toml(self.example_prefix('advanced.toml')) self.advanced_test(config)
def test_toml_basic(self): config = Config('') config.from_toml(self.example_prefix('basic.toml')) self.basic_test(config)
def test_toml_format_error(self): with pytest.raises(toml.TomlError): example = self.example_prefix('format_err.toml') config = Config('') config.from_toml(example)