@@ -1754,7 +1754,7 @@ def test_get_list_column_type_from_js_property_fallback(self):
17541754
17551755
17561756@pytest .mark .parametrize (
1757- "schema, expected " ,
1757+ "json_schema, expected_columns " ,
17581758 [
17591759 (
17601760 {
@@ -1784,25 +1784,25 @@ def test_get_list_column_type_from_js_property_fallback(self):
17841784 ids = ["one column" , "three columns" ],
17851785)
17861786def test_create_columns_from_json_schema (
1787- schema : dict [str , Any ], expected : list [Column ]
1787+ json_schema : dict [str , Any ], expected_columns : list [Column ]
17881788):
17891789 """Test successful column creation from JSON schema."""
1790- assert _create_columns_from_json_schema (schema ) == expected
1790+ assert _create_columns_from_json_schema (json_schema ) == expected_columns
17911791
17921792
17931793@pytest .mark .parametrize (
1794- "schema " ,
1794+ "json_schema " ,
17951795 [{}, {"properties" : []}],
17961796 ids = ["empty schema" , "properties is not a dict" ],
17971797)
1798- def test_create_columns_from_json_schema_exceptions (schema : dict [str , Any ]):
1798+ def test_create_columns_from_json_schema_exceptions (json_schema : dict [str , Any ]):
17991799 """Test exceptions when creating columns from invalid JSON schema."""
18001800 with pytest .raises (ValueError ):
1801- _create_columns_from_json_schema (schema )
1801+ _create_columns_from_json_schema (json_schema )
18021802
18031803
18041804@pytest .mark .parametrize (
1805- "prop, name, expected_type " ,
1805+ "json_schema_property, property_name, expected_column_type " ,
18061806 [
18071807 (
18081808 {"type" : "array" , "items" : {"type" : "string" }},
@@ -1828,17 +1828,21 @@ def test_create_columns_from_json_schema_exceptions(schema: dict[str, Any]):
18281828 ids = ["string_list" , "integer_list" , "boolean_list" , "string" ],
18291829)
18301830def test_create_synapse_column_from_js_property (
1831- prop : dict [str , Any ], name : str , expected_type : ColumnType
1831+ json_schema_property : dict [str , Any ],
1832+ property_name : str ,
1833+ expected_column_type : ColumnType ,
18321834):
18331835 """Test successful column creation from JSON schema property."""
1834- result = _create_synapse_column_from_js_property (prop , name )
1836+ result = _create_synapse_column_from_js_property (
1837+ json_schema_property , property_name
1838+ )
18351839 assert isinstance (result , Column )
1836- assert result .name == name
1837- assert result .column_type == expected_type
1840+ assert result .name == property_name
1841+ assert result .column_type == expected_column_type
18381842
18391843
18401844@pytest .mark .parametrize (
1841- "prop, expected " ,
1845+ "json_schema_property, expected_column_type " ,
18421846 [
18431847 ({"enum" : ["a" , "b" , "c" ]}, ColumnType .MEDIUMTEXT ),
18441848 ({"type" : "string" }, ColumnType .MEDIUMTEXT ),
@@ -1866,9 +1870,13 @@ def test_create_synapse_column_from_js_property(
18661870 "empty_property" ,
18671871 ],
18681872)
1869- def test_get_column_type_from_js_property (prop : dict [str , Any ], expected : ColumnType ):
1873+ def test_get_column_type_from_js_property (
1874+ json_schema_property : dict [str , Any ], expected_column_type : ColumnType
1875+ ):
18701876 """Test getting column type from JSON schema property."""
1871- assert _get_column_type_from_js_property (prop ) == expected
1877+ assert (
1878+ _get_column_type_from_js_property (json_schema_property ) == expected_column_type
1879+ )
18721880
18731881
18741882class TestGetLatestSchemaUri (unittest .TestCase ):
0 commit comments