def setUp(self): self.config = Config.from_sections({ 'section': { 'key': 'value', }, 'empty_section': {}, })
def setUp(self): self.config = Config.from_sections({ 'section': { 'an_int': '10', 'not_an_int': 'xxx', 'a_key': 'a_value', } })
def test_config_from_filename(mock_parser): mock_config = create_autospec(SafeConfigParser) mock_parser.return_value = mock_config config = Config.from_filename(sentinel.filename) mock_parser.assert_called_once_with() mock_config.read.assert_called_once_with([sentinel.filename]) eq_(config._config, mock_config)
def _test_sections(sections, expected_user, expected_name): config = Config.from_sections(sections) data = Github.get_repo_data_from_config(config) eq_(data.user, expected_user) eq_(data.name, expected_name)