Exemple #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'})
Exemple #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'})
Exemple #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'
         })
Exemple #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/'})
Exemple #5
0
 def test_raise_exception_on_host_only(self):
     with pytest.raises(ConfigError):
         validate_config({'MONGODB_HOST': 'somehost'})
Exemple #6
0
 def test_validate_with_auth(self):
     validate_config({'MONGODB_HOST': 'mongodb://*****:*****@somewhere.com:1234/mydb'})
Exemple #7
0
 def test_validate_default_value(self):
     validate_config({'MONGODB_HOST': Defaults.MONGODB_HOST})
Exemple #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/'})
Exemple #9
0
 def test_raise_exception_on_host_only(self):
     with pytest.raises(ConfigError):
         validate_config({'MONGODB_HOST': 'somehost'})
Exemple #10
0
 def test_validate_with_auth(self):
     validate_config({'MONGODB_HOST': 'mongodb://*****:*****@somewhere.com:1234/mydb'})
Exemple #11
0
 def test_validate_default_value(self):
     validate_config({'MONGODB_HOST': Defaults.MONGODB_HOST})