コード例 #1
0
 def test_host_is_non_string(self):
     config = PluginCallConfiguration({}, {importer_constants.KEY_PROXY_HOST: 7})
     try:
         importer_config.validate_proxy_host(config)
         self.fail()
     except ValueError, e:
         self.assertTrue('int' in e[0])
コード例 #2
0
ファイル: test_importer_config.py プロジェクト: pombreda/pulp
 def test_host_is_non_string(self):
     config = PluginCallConfiguration({}, {importer_constants.KEY_PROXY_HOST: 7})
     try:
         importer_config.validate_proxy_host(config)
         self.fail()
     except ValueError, e:
         self.assertTrue('int' in e[0])
コード例 #3
0
    def test_required_when_other_parameters_are_present(self):

        dependent_parameters = (
            {importer_constants.KEY_PROXY_PASS : '******'},
            {importer_constants.KEY_PROXY_USER : '******'},
            {importer_constants.KEY_PROXY_PORT : 8080},
        )

        for parameters in dependent_parameters:
                # Each of the above configurations should cause the validator to complain about
                # the proxy_url missing
                config = PluginCallConfiguration({}, parameters)
                try:
                    importer_config.validate_proxy_host(config)
                    self.fail()
                except ValueError, e:
                    self.assertTrue(importer_constants.KEY_PROXY_HOST in e[0])
コード例 #4
0
ファイル: test_importer_config.py プロジェクト: pombreda/pulp
    def test_required_when_other_parameters_are_present(self):

        dependent_parameters = (
            {importer_constants.KEY_PROXY_PASS: '******'},
            {importer_constants.KEY_PROXY_USER: '******'},
            {importer_constants.KEY_PROXY_PORT: 8080},
        )

        for parameters in dependent_parameters:
                # Each of the above configurations should cause the validator to complain about
                # the proxy_url missing
                config = PluginCallConfiguration({}, parameters)
                try:
                    importer_config.validate_proxy_host(config)
                    self.fail()
                except ValueError, e:
                    self.assertTrue(importer_constants.KEY_PROXY_HOST in e[0])
コード例 #5
0
 def test_optional(self):
     config = PluginCallConfiguration({}, {})
     importer_config.validate_proxy_host(config)
コード例 #6
0
 def test_validate(self):
     config = PluginCallConfiguration(
         {}, {importer_constants.KEY_PROXY_HOST: 'http://fake.com/'})
     importer_config.validate_proxy_host(config)
コード例 #7
0
 def test_optional(self):
     config = PluginCallConfiguration({}, {})
     importer_config.validate_proxy_host(config)
コード例 #8
0
 def test_validate(self):
     config = PluginCallConfiguration({}, {importer_constants.KEY_PROXY_HOST: 'http://fake.com/'})
     importer_config.validate_proxy_host(config)