예제 #1
0
    def test_valid(self):
        # Setup
        config = PluginCallConfiguration({}, {})  # an empty configuration is valid

        # Test
        result, error = config_validate.validate(config)

        # Verify
        self.assertEqual(result, True)
        self.assertEqual(error, None)
예제 #2
0
    def test_valid(self):
        # Setup
        config = PluginCallConfiguration({},
                                         {})  # an empty configuration is valid

        # Test
        result, error = config_validate.validate(config)

        # Verify
        self.assertEqual(result, True)
        self.assertEqual(error, None)
예제 #3
0
    def test_invalid(self):
        # Setup
        config = PluginCallConfiguration({}, {importer_constants.KEY_PROXY_PORT : 'foo'}) # should always be wrong

        # Test
        result, error = config_validate.validate(config)

        # Verify
        self.assertEqual(False, result)
        self.assertTrue('Configuration errors' in error)
        self.assertTrue(not error.endswith('\n')) # make sure trailing \n is stripped off
예제 #4
0
    def test_invalid(self):
        # Setup
        config = PluginCallConfiguration(
            {}, {importer_constants.KEY_PROXY_PORT: 'foo'
                 })  # should always be wrong

        # Test
        result, error = config_validate.validate(config)

        # Verify
        self.assertEqual(False, result)
        self.assertTrue('Configuration errors' in error)
        self.assertTrue(
            not error.endswith('\n'))  # make sure trailing \n is stripped off
예제 #5
0
 def validate_config(self, repo, config):
     return config_validate.validate(config)