Ejemplo n.º 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()
Ejemplo n.º 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()
Ejemplo n.º 3
0
    def test_context_cleared(self):
        with mock_validate_config():
            main.validate_castellan_config()

        self.assertFalse(context.has_ctx())
Ejemplo n.º 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()
Ejemplo n.º 5
0
    def test_context_cleared(self):
        with mock_validate_config():
            main.validate_castellan_config()

        self.assertFalse(context.has_ctx())
Ejemplo n.º 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()