示例#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()