From 79587ab4a6fbcf65a81571267678bc1b5bff19a1 Mon Sep 17 00:00:00 2001 From: Shane Jaroch Date: Fri, 12 Apr 2024 18:03:05 -0400 Subject: [PATCH] fully cover services/__init__.py --- tests/aaa/test_init.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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 -- 2.52.0