Remove real database in favour of simulated
This commit is contained in:
@@ -19,16 +19,16 @@ def test_data_manipulation(uc2_network):
|
||||
db_service.backup_database()
|
||||
|
||||
# First check that the DB client on the web_server can successfully query the users table on the database
|
||||
assert db_client.query("SELECT * FROM user;")
|
||||
assert db_client.query("SELECT")
|
||||
|
||||
# Now we run the DataManipulationBot
|
||||
db_manipulation_bot.run()
|
||||
|
||||
# Now check that the DB client on the web_server cannot query the users table on the database
|
||||
assert not db_client.query("SELECT * FROM user;")
|
||||
assert not db_client.query("SELECT")
|
||||
|
||||
# Now restore the database
|
||||
db_service.restore_backup()
|
||||
|
||||
# Now check that the DB client on the web_server can successfully query the users table on the database
|
||||
assert db_client.query("SELECT * FROM user;")
|
||||
assert db_client.query("SELECT")
|
||||
|
||||
@@ -57,7 +57,7 @@ def test_database_client_query(uc2_network):
|
||||
db_client: DatabaseClient = web_server.software_manager.software["DatabaseClient"]
|
||||
db_client.connect()
|
||||
|
||||
assert db_client.query("SELECT * FROM user;")
|
||||
assert db_client.query("SELECT")
|
||||
|
||||
|
||||
def test_create_database_backup(uc2_network):
|
||||
|
||||
@@ -17,4 +17,4 @@ def test_creation():
|
||||
assert data_manipulation_bot.name == "DataManipulationBot"
|
||||
assert data_manipulation_bot.port == Port.POSTGRES_SERVER
|
||||
assert data_manipulation_bot.protocol == IPProtocol.TCP
|
||||
assert data_manipulation_bot.payload == "DROP TABLE IF EXISTS user;"
|
||||
assert data_manipulation_bot.payload == "DELETE"
|
||||
|
||||
Reference in New Issue
Block a user