Esempio n. 1
0
 def test_warn_on_deprecated_db_port(self):
     with pytest.deprecated_call():
         validate_config({'MONGODB_HOST': Defaults.MONGODB_HOST,
                          'MONGODB_PORT': 1234})
     with pytest.deprecated_call():
         validate_config({'MONGODB_HOST': Defaults.MONGODB_HOST,
                          'MONGODB_DB': 'udata'})
Esempio n. 2
0
 def test_warn_on_deprecated_db_port(self):
     with pytest.deprecated_call():
         validate_config({'MONGODB_HOST': Defaults.MONGODB_HOST,
                          'MONGODB_PORT': 1234})
     with pytest.deprecated_call():
         validate_config({'MONGODB_HOST': Defaults.MONGODB_HOST,
                          'MONGODB_DB': 'udata'})
Esempio n. 3
0
 def test_warn_on_deprecated_db_port(self):
     with self.assert_warn(DeprecationWarning):
         validate_config({
             'MONGODB_HOST': Defaults.MONGODB_HOST,
             'MONGODB_PORT': 1234
         })
     with self.assert_warn(DeprecationWarning):
         validate_config({
             'MONGODB_HOST': Defaults.MONGODB_HOST,
             'MONGODB_DB': 'udata'
         })
Esempio n. 4
0
 def test_raise_exception_on_missing_db(self):
     with pytest.raises(ConfigError):
         validate_config({'MONGODB_HOST': 'mongodb://somewhere.com:1234'})
     with pytest.raises(ConfigError):
         validate_config({'MONGODB_HOST': 'mongodb://somewhere.com:1234/'})
Esempio n. 5
0
 def test_raise_exception_on_host_only(self):
     with pytest.raises(ConfigError):
         validate_config({'MONGODB_HOST': 'somehost'})
Esempio n. 6
0
 def test_validate_with_auth(self):
     validate_config({'MONGODB_HOST': 'mongodb://*****:*****@somewhere.com:1234/mydb'})
Esempio n. 7
0
 def test_validate_default_value(self):
     validate_config({'MONGODB_HOST': Defaults.MONGODB_HOST})
Esempio n. 8
0
 def test_raise_exception_on_missing_db(self):
     with pytest.raises(ConfigError):
         validate_config({'MONGODB_HOST': 'mongodb://somewhere.com:1234'})
     with pytest.raises(ConfigError):
         validate_config({'MONGODB_HOST': 'mongodb://somewhere.com:1234/'})
Esempio n. 9
0
 def test_raise_exception_on_host_only(self):
     with pytest.raises(ConfigError):
         validate_config({'MONGODB_HOST': 'somehost'})
Esempio n. 10
0
 def test_validate_with_auth(self):
     validate_config({'MONGODB_HOST': 'mongodb://*****:*****@somewhere.com:1234/mydb'})
Esempio n. 11
0
 def test_validate_default_value(self):
     validate_config({'MONGODB_HOST': Defaults.MONGODB_HOST})