File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -225,3 +225,23 @@ def test_translate_default_from_mysql_to_sqlite_bytes(self) -> None:
225
225
"""Test _translate_default_from_mysql_to_sqlite with bytes default."""
226
226
result = MySQLtoSQLite ._translate_default_from_mysql_to_sqlite (b"abc" , column_type = "BLOB" )
227
227
assert result .startswith ("DEFAULT x'" )
228
+
229
+ def test_translate_default_from_mysql_to_sqlite_curtime (self ) -> None :
230
+ """Test _translate_default_from_mysql_to_sqlite with curtime()."""
231
+ assert MySQLtoSQLite ._translate_default_from_mysql_to_sqlite ("curtime()" ) == "DEFAULT CURRENT_TIME"
232
+ assert MySQLtoSQLite ._translate_default_from_mysql_to_sqlite ("CURTIME()" ) == "DEFAULT CURRENT_TIME"
233
+
234
+ def test_translate_default_from_mysql_to_sqlite_curdate (self ) -> None :
235
+ """Test _translate_default_from_mysql_to_sqlite with curdate()."""
236
+ assert MySQLtoSQLite ._translate_default_from_mysql_to_sqlite ("curdate()" ) == "DEFAULT CURRENT_DATE"
237
+ assert MySQLtoSQLite ._translate_default_from_mysql_to_sqlite ("CURDATE()" ) == "DEFAULT CURRENT_DATE"
238
+
239
+ def test_translate_default_from_mysql_to_sqlite_current_timestamp_with_parentheses (self ) -> None :
240
+ """Test _translate_default_from_mysql_to_sqlite with current_timestamp()."""
241
+ assert MySQLtoSQLite ._translate_default_from_mysql_to_sqlite ("current_timestamp()" ) == "DEFAULT CURRENT_TIMESTAMP"
242
+ assert MySQLtoSQLite ._translate_default_from_mysql_to_sqlite ("CURRENT_TIMESTAMP()" ) == "DEFAULT CURRENT_TIMESTAMP"
243
+
244
+ def test_translate_default_from_mysql_to_sqlite_now (self ) -> None :
245
+ """Test _translate_default_from_mysql_to_sqlite with now()."""
246
+ assert MySQLtoSQLite ._translate_default_from_mysql_to_sqlite ("now()" ) == "DEFAULT CURRENT_TIMESTAMP"
247
+ assert MySQLtoSQLite ._translate_default_from_mysql_to_sqlite ("NOW()" ) == "DEFAULT CURRENT_TIMESTAMP"
You can’t perform that action at this time.
0 commit comments