def test_context_present_when_calling_validate_config(self): def check_context(): self.assertTrue(context.has_ctx()) with mock_validate_config() as validate_config: validate_config.side_effect = check_context main.validate_castellan_config()
def test_context_cleared(self): with mock_validate_config(): main.validate_castellan_config() self.assertFalse(context.has_ctx())
def test_castellan_validate_config_called(self): with mock_validate_config() as validate_config: main.validate_castellan_config() validate_config.assert_called_once_with()