@@ -14,7 +14,6 @@ class FunctionalTestCase(RequiresDBTestCase):
1414
1515 def test_version_command (self ) -> None :
1616 """Check that the version command works."""
17-
1817 completed_process = run (
1918 ["sqlsynthgen" , "version" ],
2019 capture_output = True ,
@@ -40,10 +39,10 @@ class DBFunctionalTestCase(RequiresDBTestCase):
4039 alt_ssg_file_path = Path ("my_ssg.py" )
4140
4241 vocabulary_file_paths = tuple (
43- map (Path , ("concept.yaml" , "concept_type.yaml" , "mitigation_type.yaml" ))
42+ map (Path , ("concept.yaml" , "concept_type.yaml" , "mitigation_type.yaml" )),
4443 )
4544 generator_file_paths = tuple (
46- map (Path , ("story_generators.py" , "row_generators.py" ))
45+ map (Path , ("story_generators.py" , "row_generators.py" )),
4746 )
4847 dump_file_path = Path ("dst.dump" )
4948 config_file_path = Path ("example_config.yaml" )
@@ -60,7 +59,6 @@ class DBFunctionalTestCase(RequiresDBTestCase):
6059
6160 def setUp (self ) -> None :
6261 """Pre-test setup."""
63-
6462 # Create a mostly-blank destination database
6563 run_psql (self .examples_dir / self .dump_file_path )
6664
@@ -103,6 +101,16 @@ def test_workflow_minimal_args(self) -> None:
103101 # this could mean that we might accidentally violate the constraints. In
104102 # practice this won't happen because we only write one row to an empty table.
105103 self .assertEqual (
104+ "Unsupported SQLAlchemy type "
105+ "<class 'sqlalchemy.dialects.postgresql.types.CIDR'> "
106+ "for column column_with_unusual_type. "
107+ "Setting this column to NULL always, "
108+ "you may want to configure a row generator for it instead.\n "
109+ "Unsupported SQLAlchemy type "
110+ "<class 'sqlalchemy.dialects.postgresql.types.BIT'> "
111+ "for column column_with_unusual_type_and_length. "
112+ "Setting this column to NULL always, "
113+ "you may want to configure a row generator for it instead.\n "
106114 "A unique constraint (ab_uniq) isn't fully covered by one "
107115 "row generator (['a']). Enforcement of the constraint may not work.\n "
108116 "A unique constraint (ab_uniq) isn't fully covered by one "
@@ -188,7 +196,6 @@ def test_workflow_minimal_args(self) -> None:
188196
189197 def test_workflow_maximal_args (self ) -> None :
190198 """Test the CLI workflow runs with optional arguments."""
191-
192199 completed_process = run (
193200 [
194201 "sqlsynthgen" ,
@@ -257,7 +264,19 @@ def test_workflow_maximal_args(self) -> None:
257264 capture_output = True ,
258265 env = self .env ,
259266 )
260- self .assertEqual ("" , completed_process .stderr .decode ("utf-8" ))
267+ self .assertEqual (
268+ "Unsupported SQLAlchemy type "
269+ "<class 'sqlalchemy.dialects.postgresql.types.CIDR'> "
270+ "for column column_with_unusual_type. "
271+ "Setting this column to NULL always, "
272+ "you may want to configure a row generator for it instead.\n "
273+ "Unsupported SQLAlchemy type "
274+ "<class 'sqlalchemy.dialects.postgresql.types.BIT'> "
275+ "for column column_with_unusual_type_and_length. "
276+ "Setting this column to NULL always, "
277+ "you may want to configure a row generator for it instead.\n " ,
278+ completed_process .stderr .decode ("utf-8" ),
279+ )
261280 self .assertSuccess (completed_process )
262281 self .assertEqual (
263282 f"Making { self .alt_ssg_file_path } .\n "
@@ -345,6 +364,7 @@ def test_workflow_maximal_args(self) -> None:
345364 'Generating data for table "data_type_test".\n '
346365 'Generating data for table "no_pk_test".\n '
347366 'Generating data for table "person".\n '
367+ 'Generating data for table "strange_type_table".\n '
348368 'Generating data for table "unique_constraint_test".\n '
349369 'Generating data for table "unique_constraint_test2".\n '
350370 'Generating data for table "test_entity".\n '
@@ -358,6 +378,7 @@ def test_workflow_maximal_args(self) -> None:
358378 'Generating data for table "data_type_test".\n '
359379 'Generating data for table "no_pk_test".\n '
360380 'Generating data for table "person".\n '
381+ 'Generating data for table "strange_type_table".\n '
361382 'Generating data for table "unique_constraint_test".\n '
362383 'Generating data for table "unique_constraint_test2".\n '
363384 'Generating data for table "test_entity".\n '
@@ -367,6 +388,7 @@ def test_workflow_maximal_args(self) -> None:
367388 f"hospital_visit: { 2 * (2 * 2 + 3 )} rows created.\n "
368389 "data_type_test: 2 rows created.\n "
369390 "no_pk_test: 2 rows created.\n "
391+ "strange_type_table: 2 rows created.\n "
370392 "unique_constraint_test: 2 rows created.\n "
371393 "unique_constraint_test2: 2 rows created.\n "
372394 "test_entity: 2 rows created.\n " ,
@@ -394,6 +416,7 @@ def test_workflow_maximal_args(self) -> None:
394416 'Truncating table "test_entity".\n '
395417 'Truncating table "unique_constraint_test2".\n '
396418 'Truncating table "unique_constraint_test".\n '
419+ 'Truncating table "strange_type_table".\n '
397420 'Truncating table "person".\n '
398421 'Truncating table "no_pk_test".\n '
399422 'Truncating table "data_type_test".\n '
@@ -459,7 +482,6 @@ def test_unique_constraint_fail(self) -> None:
459482 We also deliberately call create-data multiple times to make sure that the
460483 loading of existing keys from the database at start up works as expected.
461484 """
462-
463485 # This is all exactly the same stuff we run in test_workflow_maximal_args.
464486 run (
465487 [
0 commit comments