File tree Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -168,6 +168,8 @@ class Default:
168
168
bool : "INTEGER" ,
169
169
str : "TEXT" ,
170
170
dict : "TEXT" ,
171
+ tuple : "TEXT" ,
172
+ list : "TEXT" ,
171
173
bytes .__class__ : "BLOB" ,
172
174
bytes : "BLOB" ,
173
175
memoryview : "BLOB" ,
Original file line number Diff line number Diff line change @@ -1040,3 +1040,30 @@ def test_create_with_nested_bytes(fresh_db):
1040
1040
)
1041
1041
def test_quote (fresh_db , input , expected ):
1042
1042
assert fresh_db .quote (input ) == expected
1043
+
1044
+
1045
+ @pytest .mark .parametrize (
1046
+ "columns,expected_sql_middle" ,
1047
+ (
1048
+ (
1049
+ {"id" : int },
1050
+ "[id] INTEGER" ,
1051
+ ),
1052
+ (
1053
+ {"col" : dict },
1054
+ "[col] TEXT" ,
1055
+ ),
1056
+ (
1057
+ {"col" : tuple },
1058
+ "[col] TEXT" ,
1059
+ ),
1060
+ (
1061
+ {"col" : list },
1062
+ "[col] TEXT" ,
1063
+ ),
1064
+ ),
1065
+ )
1066
+ def test_create_table_sql (fresh_db , columns , expected_sql_middle ):
1067
+ sql = fresh_db .create_table_sql ("t" , columns )
1068
+ middle = sql .split ("(" )[1 ].split (")" )[0 ].strip ()
1069
+ assert middle == expected_sql_middle
You can’t perform that action at this time.
0 commit comments