Skip to content

Commit fe6c277

Browse files
committed
fix update test cases
1 parent 507175f commit fe6c277

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

test/integration/models/database/test_database.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ def get_db_status():
8989

9090

9191
@pytest.mark.skipif(
92-
os.getenv("RUN_DB_FORK_TESTS") is None,
93-
reason="RUN_DB_FORK_TESTS environment variable not set",
92+
os.getenv("RUN_DB_FORK_TESTS", "").strip().lower() not in {"yes", "true"},
93+
reason="RUN_DB_FORK_TESTS environment variable must be set to 'yes' or 'true' (case insensitive)",
9494
)
9595
def test_fork_sql_db(test_linode_client, test_create_sql_db):
9696
client = test_linode_client
@@ -110,8 +110,8 @@ def get_db_fork_status():
110110

111111

112112
@pytest.mark.skipif(
113-
os.getenv("RUN_DB_FORK_TESTS") is None,
114-
reason="RUN_DB_FORK_TESTS environment variable not set",
113+
os.getenv("RUN_DB_FORK_TESTS", "").strip().lower() not in {"yes", "true"},
114+
reason="RUN_DB_FORK_TESTS environment variable must be set to 'yes' or 'true' (case insensitive)",
115115
)
116116
def test_fork_postgres_db(test_linode_client, test_create_postgres_db):
117117
client = test_linode_client
@@ -202,8 +202,6 @@ def test_update_sql_db(test_linode_client, test_create_sql_db):
202202

203203
res = db.save()
204204

205-
database = test_linode_client.load(MySQLDatabase, test_create_sql_db.id)
206-
207205
wait_for_condition(
208206
30,
209207
300,
@@ -213,6 +211,8 @@ def test_update_sql_db(test_linode_client, test_create_sql_db):
213211
"active",
214212
)
215213

214+
database = test_linode_client.load(MySQLDatabase, test_create_sql_db.id)
215+
216216
assert res
217217
assert database.allow_list == new_allow_list
218218
assert database.label == label
@@ -415,10 +415,6 @@ def test_update_postgres_db(test_linode_client, test_create_postgres_db):
415415

416416
res = db.save()
417417

418-
database = test_linode_client.load(
419-
PostgreSQLDatabase, test_create_postgres_db.id
420-
)
421-
422418
wait_for_condition(
423419
30,
424420
1000,
@@ -428,6 +424,10 @@ def test_update_postgres_db(test_linode_client, test_create_postgres_db):
428424
"active",
429425
)
430426

427+
database = test_linode_client.load(
428+
PostgreSQLDatabase, test_create_postgres_db.id
429+
)
430+
431431
assert res
432432
assert database.allow_list == new_allow_list
433433
assert database.label == label

0 commit comments

Comments
 (0)