From: Shane Jaroch Date: Fri, 12 Apr 2024 22:03:05 +0000 (-0400) Subject: fully cover services/__init__.py X-Git-Tag: v0.2.8.dev2~37 X-Git-Url: https://git.nutra.tk/v2?a=commitdiff_plain;h=79587ab4a6fbcf65a81571267678bc1b5bff19a1;p=nutratech%2Fcli.git fully cover services/__init__.py --- diff --git a/tests/aaa/test_init.py b/tests/aaa/test_init.py index 3fa0931..bfab1e3 100644 --- a/tests/aaa/test_init.py +++ b/tests/aaa/test_init.py @@ -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