def test_update_data_2(a): """Test update_data.""" with pytest.raises(Exception): DatabaseIngestion.update_data(None) a.side_effect = SQLAlchemyError() with pytest.raises(Exception): DatabaseIngestion.update_data(None)
def test_get_info_1(a): """Test get_info.""" resp = DatabaseIngestion.get_info("test") assert resp == {'error': 'No information in the records', 'is_valid': False} a.side_effect = SQLAlchemyError() with pytest.raises(Exception): DatabaseIngestion.get_info("test") a.side_effect = Exception() with pytest.raises(Exception): DatabaseIngestion.get_info("test")
def test_get_store_record_2(a): """Test get_store_record.""" with pytest.raises(Exception): payload = { "email-ids": "*****@*****.**", "git-sha": "somesha", "git-url": "test" } DatabaseIngestion.store_record(payload) a.side_effect = Exception() with pytest.raises(Exception): payload = { "email-ids": "*****@*****.**", "git-sha": "somesha", "git-url": "test" } DatabaseIngestion.store_record(payload)
def test_get_store_record_1(_a, _b): """Test get_store_record.""" payload = { "email-ids": "*****@*****.**", "git-sha": "somesha", "git-url": "test" } resp = DatabaseIngestion.store_record(payload) assert resp == "get_info"
def test_get_info(): """Test get_info.""" resp = DatabaseIngestion.get_info(None) assert resp == {'error': 'No key found', 'is_valid': False}
def test_get_store_record(): """Test get_store_record.""" with pytest.raises(Exception): DatabaseIngestion.store_record({ "test": "test" })
def test_update_data_1(a): """Test update_data.""" DatabaseIngestion.update_data(None)