예제 #1
0
    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()
예제 #2
0
    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()
예제 #3
0
    def test_context_cleared(self):
        with mock_validate_config():
            main.validate_castellan_config()

        self.assertFalse(context.has_ctx())
예제 #4
0
    def test_castellan_validate_config_called(self):
        with mock_validate_config() as validate_config:
            main.validate_castellan_config()

        validate_config.assert_called_once_with()
예제 #5
0
    def test_context_cleared(self):
        with mock_validate_config():
            main.validate_castellan_config()

        self.assertFalse(context.has_ctx())
예제 #6
0
    def test_castellan_validate_config_called(self):
        with mock_validate_config() as validate_config:
            main.validate_castellan_config()

        validate_config.assert_called_once_with()