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