]> Nutra Git (v1) - nutratech/cli.git/commitdiff
fully cover services/__init__.py
authorShane Jaroch <chown_tee@proton.me>
Fri, 12 Apr 2024 22:03:05 +0000 (18:03 -0400)
committerShane Jaroch <chown_tee@proton.me>
Fri, 12 Apr 2024 22:03:05 +0000 (18:03 -0400)
tests/aaa/test_init.py

index 3fa0931d76055b07de1ac2ae607e26d5ecaa4101..bfab1e36f55bfefa38cb5907e07d5664780bc2d8 100644 (file)
@@ -7,11 +7,16 @@ Created on Sun Feb 25 16:43:56 2024
 NOTE: these tests are in a folder "aaa\" which is alphabetically RUN FIRST.
       Other tests, such as test_bug, depend on having the newer version of nt.sqlite3
 """
+from unittest.mock import patch
+
 from ntclient.services import init
 
 
-def test_init():
+def test_init() -> None:
     """Tests the SQL/persistence init in real time"""
-    code, result = init(yes=True)
+    with patch("os.path.isdir", return_value=False):
+        with patch("os.makedirs", return_value=None):
+            code, result = init(yes=True)
+
     assert code == 0
     assert result