Add unit tests

This commit is contained in:
William Welter 2024-01-04 18:26:49 +00:00
parent ed93655df8
commit 6eec7404b3

View file

@ -35,3 +35,17 @@ def test_get_info_suffix(suffix, cursor_output, server_implementation):
info = MySQL_Info(MagicMock(), cursor, server_implementation) info = MySQL_Info(MagicMock(), cursor, server_implementation)
assert info.get_info([], [], False)['version']['suffix'] == suffix assert info.get_info([], [], False)['version']['suffix'] == suffix
def test_is_mariadb(server_implementation):
cursor = MagicMock()
info = MySQL_Info(MagicMock(), cursor, server_implementation)
assert info.is_mariadb() == ( server_implementation == "mariadb" )
def test_is_mysql(server_implementation):
cursor = MagicMock()
info = MySQL_Info(MagicMock(), cursor, server_implementation)
assert info.is_mysql() == ( server_implementation == "mysql" )