From 6eec7404b34ae42a6183bff4a968a7c393e2360d Mon Sep 17 00:00:00 2001 From: William Welter Date: Thu, 4 Jan 2024 18:26:49 +0000 Subject: [PATCH] Add unit tests --- tests/unit/plugins/modules/test_mysql_info.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/unit/plugins/modules/test_mysql_info.py b/tests/unit/plugins/modules/test_mysql_info.py index 6aaf66e..138bd01 100644 --- a/tests/unit/plugins/modules/test_mysql_info.py +++ b/tests/unit/plugins/modules/test_mysql_info.py @@ -35,3 +35,17 @@ def test_get_info_suffix(suffix, cursor_output, server_implementation): info = MySQL_Info(MagicMock(), cursor, server_implementation) 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" )