def test_it_should_write_to_settings_correctly_with_the_decorator(self): @write_to_settings() def a_method(): pass expect(lambda: config.get(DEFAULT_SECTION, 'a_setting_key')).to.throw( NoOptionError) a_method(a_setting_key='a value') # pylint: disable=E1123 expect(config.get(DEFAULT_SECTION, 'a_setting_key')).to.equal('a value')
def test_it_should_return_default_settings(self): expect(config.get(DEFAULT_SECTION, SETTING_SKILLS)).to.equal(DEFAULT_SETTING_SKILLS) expect(config.get(DEFAULT_SECTION, SETTING_DEFAULT_REPO_URL)).to.equal( DEFAULT_SETTING_DEFAULT_REPO_URL)
def test_it_should_set_the_setting_even_if_the_section_does_not_exists_yet( self): set_setting('my_key', 'a value', section='my_section') expect(config.get('my_section', 'my_key')).to.equal('a value')