mirror of
https://github.com/jcreek/CosmicClash.git
synced 2026-09-11 08:23:45 +00:00
fix(multiplayer): constrain ranked arena paths in postgres
This commit is contained in:
@@ -7,6 +7,7 @@ import unittest
|
||||
SQL = (Path(__file__).parent / "0001_initial.sql").read_text()
|
||||
ASSIGNMENTS_SQL = (Path(__file__).parent / "0002_assignments.sql").read_text()
|
||||
QUOTAS_SQL = (Path(__file__).parent / "0007_allocation_quotas.sql").read_text()
|
||||
ARENAS_SQL = (Path(__file__).parent / "0008_match_arena_paths.sql").read_text()
|
||||
|
||||
|
||||
class MigrationTest(unittest.TestCase):
|
||||
@@ -59,6 +60,14 @@ class MigrationTest(unittest.TestCase):
|
||||
self.assertIn(fragment, QUOTAS_SQL)
|
||||
self.assertIn("region IN ('EU', 'NA')", QUOTAS_SQL)
|
||||
|
||||
def test_ranked_arena_paths_are_database_enforced_for_new_rows(self):
|
||||
for fragment in (
|
||||
"proposals_ranked_arena_path", "matches_ranked_arena_path", "NOT VALID",
|
||||
"match_arena_path IS NOT NULL", "arena_path IS NOT NULL",
|
||||
"res://scenes/arena_01.tscn", "res://scenes/arena_02.tscn", "res://scenes/arena_03.tscn",
|
||||
):
|
||||
self.assertIn(fragment, ARENAS_SQL)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
||||
Reference in New Issue
Block a user