Exemplo n.º 1
0
 def test_valid(self):
     config = PluginCallConfiguration(
         {}, {
             importer_constants.KEY_BASIC_AUTH_PASS: '******',
             importer_constants.KEY_BASIC_AUTH_USER: '******'
         })
     importer_config.validate_basic_auth_username(config)
Exemplo n.º 2
0
 def test_username_is_non_string(self):
     config = PluginCallConfiguration({}, {importer_constants.KEY_BASIC_AUTH_USER: 185})
     try:
         importer_config.validate_basic_auth_username(config)
         self.fail()
     except ValueError, e:
         self.assertTrue('int' in e[0])
Exemplo n.º 3
0
 def test_username_is_non_string(self):
     config = PluginCallConfiguration(
         {}, {importer_constants.KEY_BASIC_AUTH_USER: 185})
     try:
         importer_config.validate_basic_auth_username(config)
         self.fail()
     except ValueError, e:
         self.assertTrue('int' in e[0])
Exemplo n.º 4
0
 def test_password_no_username(self):
     config = PluginCallConfiguration({}, {importer_constants.KEY_BASIC_AUTH_PASS: '******'})
     try:
         importer_config.validate_basic_auth_username(config)
         self.fail()
     except ValueError, e:
         self.assertTrue(importer_constants.KEY_BASIC_AUTH_USER in e[0])
         self.assertTrue(importer_constants.KEY_BASIC_AUTH_PASS in e[0])
Exemplo n.º 5
0
 def test_password_no_username(self):
     config = PluginCallConfiguration(
         {}, {importer_constants.KEY_BASIC_AUTH_PASS: '******'})
     try:
         importer_config.validate_basic_auth_username(config)
         self.fail()
     except ValueError, e:
         self.assertTrue(importer_constants.KEY_BASIC_AUTH_USER in e[0])
         self.assertTrue(importer_constants.KEY_BASIC_AUTH_PASS in e[0])
Exemplo n.º 6
0
 def test_optional(self):
     config = PluginCallConfiguration({}, {})
     importer_config.validate_basic_auth_username(config)
Exemplo n.º 7
0
 def test_optional(self):
     config = PluginCallConfiguration({}, {})
     importer_config.validate_basic_auth_username(config)
Exemplo n.º 8
0
 def test_valid(self):
     config = PluginCallConfiguration({}, {importer_constants.KEY_BASIC_AUTH_PASS: '******',
                                           importer_constants.KEY_BASIC_AUTH_USER: '******'})
     importer_config.validate_basic_auth_username(config)