def test_it_should_filter_extensions(self, examples): examples.clear() examples.get_many(FILES) expected_contents = parse(examples.get(FILES[0])) # toml file config = load_paths([str(examples.tmpdir)], extension='toml', force_extension=True) # Only reads the toml file assert_that(config, is_(expected_contents))
def test_it_should_fail_with_invalid_extensions(self, name, examples): with pytest.raises(Exception): parse(examples.get(name))
def test_it_should_fail_with_missing_files(self): with pytest.raises(Exception): parse('/path/to/nowhere.json')
def test_it_should_load_for_given_format(self, name, format, examples): config = parse(examples.get(name), format) assert_that(config, has_entry('section', has_key('string')))
def test_it_loads_strings_as_unicode(self, name, examples): config = parse(examples.get(name)) assert_that(config, has_entry('section', has_entry('unicode', is_(u'💩'))))
def test_it_should_detect_format_from_extension(self, name, examples): config = parse(examples.get(name)) assert_that(config, has_entry('section', has_key('string')))