refactor: Update import statements to include 'src' prefix for module paths
Build and Push Docker Image / build-and-push (push) Has been cancelled
Build and Push Docker Image / build-and-push (push) Has been cancelled
This commit is contained in:
@@ -12,7 +12,7 @@ sys.path.insert(0, os.path.join(os.path.dirname(__file__), "src"))
|
|||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from ui_manager import UIManager
|
from src.ui_manager import UIManager
|
||||||
|
|
||||||
|
|
||||||
def test_automated_multiple_punches():
|
def test_automated_multiple_punches():
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import sys
|
|||||||
# Add the src directory to the Python path
|
# Add the src directory to the Python path
|
||||||
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "src"))
|
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "src"))
|
||||||
|
|
||||||
from data_manager import DataManager
|
from src.data_manager import DataManager
|
||||||
|
|
||||||
# Set up simple logging
|
# Set up simple logging
|
||||||
logging.basicConfig(level=logging.DEBUG)
|
logging.basicConfig(level=logging.DEBUG)
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import sys
|
|||||||
# Add the src directory to the path so we can import our modules
|
# Add the src directory to the path so we can import our modules
|
||||||
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "src"))
|
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "src"))
|
||||||
|
|
||||||
from data_manager import DataManager
|
from src.data_manager import DataManager
|
||||||
|
|
||||||
|
|
||||||
def test_delete_functionality():
|
def test_delete_functionality():
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ sys.path.insert(0, os.path.join(os.path.dirname(__file__), "src"))
|
|||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from ui_manager import UIManager
|
from src.ui_manager import UIManager
|
||||||
|
|
||||||
|
|
||||||
def demonstrate_multiple_doses():
|
def demonstrate_multiple_doses():
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import sys
|
|||||||
# Add the src directory to the path so we can import our modules
|
# Add the src directory to the path so we can import our modules
|
||||||
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "src"))
|
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "src"))
|
||||||
|
|
||||||
from data_manager import DataManager
|
from src.data_manager import DataManager
|
||||||
|
|
||||||
|
|
||||||
def test_dose_editing_functionality():
|
def test_dose_editing_functionality():
|
||||||
@@ -100,7 +100,7 @@ def test_dose_editing_functionality():
|
|||||||
try:
|
try:
|
||||||
import tkinter as tk
|
import tkinter as tk
|
||||||
|
|
||||||
from ui_manager import UIManager
|
from src.ui_manager import UIManager
|
||||||
|
|
||||||
# Create a temporary UI manager to test the parsing
|
# Create a temporary UI manager to test the parsing
|
||||||
root = tk.Tk()
|
root = tk.Tk()
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ from datetime import datetime
|
|||||||
|
|
||||||
sys.path.append(os.path.join(os.path.dirname(__file__), "src"))
|
sys.path.append(os.path.join(os.path.dirname(__file__), "src"))
|
||||||
|
|
||||||
from data_manager import DataManager
|
from src.data_manager import DataManager
|
||||||
from init import logger
|
from src.init import logger
|
||||||
|
|
||||||
|
|
||||||
def test_dose_tracking():
|
def test_dose_tracking():
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ import sys
|
|||||||
# Add src to path
|
# Add src to path
|
||||||
sys.path.append(os.path.join(os.path.dirname(__file__), "src"))
|
sys.path.append(os.path.join(os.path.dirname(__file__), "src"))
|
||||||
|
|
||||||
from data_manager import DataManager
|
from src.data_manager import DataManager
|
||||||
from init import logger
|
from src.init import logger
|
||||||
|
|
||||||
|
|
||||||
def test_edit_functionality():
|
def test_edit_functionality():
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import sys
|
|||||||
# Add the src directory to the path so we can import our modules
|
# Add the src directory to the path so we can import our modules
|
||||||
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "src"))
|
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "src"))
|
||||||
|
|
||||||
from data_manager import DataManager
|
from src.data_manager import DataManager
|
||||||
|
|
||||||
|
|
||||||
def test_edit_window_functionality():
|
def test_edit_window_functionality():
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ sys.path.insert(0, os.path.join(os.path.dirname(__file__), "src"))
|
|||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from ui_manager import UIManager
|
from src.ui_manager import UIManager
|
||||||
|
|
||||||
|
|
||||||
def test_edit_window_punch_buttons():
|
def test_edit_window_punch_buttons():
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ sys.path.insert(0, os.path.join(os.path.dirname(__file__), "src"))
|
|||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from ui_manager import UIManager
|
from src.ui_manager import UIManager
|
||||||
|
|
||||||
|
|
||||||
def final_verification_test():
|
def final_verification_test():
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ sys.path.insert(0, os.path.join(os.path.dirname(__file__), "src"))
|
|||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from ui_manager import UIManager
|
from src.ui_manager import UIManager
|
||||||
|
|
||||||
|
|
||||||
def test_parse_dose_text():
|
def test_parse_dose_text():
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ sys.path.insert(0, os.path.join(os.path.dirname(__file__), "src"))
|
|||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from ui_manager import UIManager
|
from src.ui_manager import UIManager
|
||||||
|
|
||||||
|
|
||||||
def test_multiple_punch_and_save():
|
def test_multiple_punch_and_save():
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ sys.path.insert(0, os.path.join(os.path.dirname(__file__), "src"))
|
|||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from ui_manager import UIManager
|
from src.ui_manager import UIManager
|
||||||
|
|
||||||
|
|
||||||
def test_programmatic_punch():
|
def test_programmatic_punch():
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ sys.path.insert(0, os.path.join(os.path.dirname(__file__), "src"))
|
|||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from ui_manager import UIManager
|
from src.ui_manager import UIManager
|
||||||
|
|
||||||
|
|
||||||
def test_punch_button_step_by_step():
|
def test_punch_button_step_by_step():
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ sys.path.insert(0, os.path.join(os.path.dirname(__file__), "src"))
|
|||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from ui_manager import UIManager
|
from src.ui_manager import UIManager
|
||||||
|
|
||||||
|
|
||||||
def test_punch_button_only():
|
def test_punch_button_only():
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ sys.path.insert(0, os.path.join(os.path.dirname(__file__), "src"))
|
|||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from ui_manager import UIManager
|
from src.ui_manager import UIManager
|
||||||
|
|
||||||
|
|
||||||
def test_save_functionality():
|
def test_save_functionality():
|
||||||
|
|||||||
@@ -14,8 +14,8 @@ sys.path.append(os.path.join(os.path.dirname(__file__), "src"))
|
|||||||
|
|
||||||
def test_scrollable_input():
|
def test_scrollable_input():
|
||||||
"""Test the scrollable input frame."""
|
"""Test the scrollable input frame."""
|
||||||
from init import logger
|
from src.init import logger
|
||||||
from ui_manager import UIManager
|
from src.ui_manager import UIManager
|
||||||
|
|
||||||
# Create a test window
|
# Create a test window
|
||||||
root = tk.Tk()
|
root = tk.Tk()
|
||||||
|
|||||||
+25
-25
@@ -20,9 +20,9 @@ class TestConstants:
|
|||||||
if 'constants' in sys.modules:
|
if 'constants' in sys.modules:
|
||||||
importlib.reload(sys.modules['constants'])
|
importlib.reload(sys.modules['constants'])
|
||||||
else:
|
else:
|
||||||
import constants
|
import src.constants
|
||||||
|
|
||||||
assert constants.LOG_LEVEL == "INFO"
|
assert src.constants.LOG_LEVEL == "INFO"
|
||||||
|
|
||||||
def test_custom_log_level(self):
|
def test_custom_log_level(self):
|
||||||
"""Test custom LOG_LEVEL from environment."""
|
"""Test custom LOG_LEVEL from environment."""
|
||||||
@@ -31,9 +31,9 @@ class TestConstants:
|
|||||||
if 'constants' in sys.modules:
|
if 'constants' in sys.modules:
|
||||||
importlib.reload(sys.modules['constants'])
|
importlib.reload(sys.modules['constants'])
|
||||||
else:
|
else:
|
||||||
import constants
|
import src.constants
|
||||||
|
|
||||||
assert constants.LOG_LEVEL == "DEBUG"
|
assert src.constants.LOG_LEVEL == "DEBUG"
|
||||||
|
|
||||||
def test_default_log_path(self):
|
def test_default_log_path(self):
|
||||||
"""Test default LOG_PATH when not set in environment."""
|
"""Test default LOG_PATH when not set in environment."""
|
||||||
@@ -42,9 +42,9 @@ class TestConstants:
|
|||||||
if 'constants' in sys.modules:
|
if 'constants' in sys.modules:
|
||||||
importlib.reload(sys.modules['constants'])
|
importlib.reload(sys.modules['constants'])
|
||||||
else:
|
else:
|
||||||
import constants
|
import src.constants
|
||||||
|
|
||||||
assert constants.LOG_PATH == "/tmp/logs/thechart"
|
assert src.constants.LOG_PATH == "/tmp/logs/thechart"
|
||||||
|
|
||||||
def test_custom_log_path(self):
|
def test_custom_log_path(self):
|
||||||
"""Test custom LOG_PATH from environment."""
|
"""Test custom LOG_PATH from environment."""
|
||||||
@@ -53,9 +53,9 @@ class TestConstants:
|
|||||||
if 'constants' in sys.modules:
|
if 'constants' in sys.modules:
|
||||||
importlib.reload(sys.modules['constants'])
|
importlib.reload(sys.modules['constants'])
|
||||||
else:
|
else:
|
||||||
import constants
|
import src.constants
|
||||||
|
|
||||||
assert constants.LOG_PATH == "/custom/log/path"
|
assert src.constants.LOG_PATH == "/custom/log/path"
|
||||||
|
|
||||||
def test_default_log_clear(self):
|
def test_default_log_clear(self):
|
||||||
"""Test default LOG_CLEAR when not set in environment."""
|
"""Test default LOG_CLEAR when not set in environment."""
|
||||||
@@ -64,9 +64,9 @@ class TestConstants:
|
|||||||
if 'constants' in sys.modules:
|
if 'constants' in sys.modules:
|
||||||
importlib.reload(sys.modules['constants'])
|
importlib.reload(sys.modules['constants'])
|
||||||
else:
|
else:
|
||||||
import constants
|
import src.constants
|
||||||
|
|
||||||
assert constants.LOG_CLEAR == "False"
|
assert src.constants.LOG_CLEAR == "False"
|
||||||
|
|
||||||
def test_custom_log_clear_true(self):
|
def test_custom_log_clear_true(self):
|
||||||
"""Test LOG_CLEAR when set to true in environment."""
|
"""Test LOG_CLEAR when set to true in environment."""
|
||||||
@@ -75,9 +75,9 @@ class TestConstants:
|
|||||||
if 'constants' in sys.modules:
|
if 'constants' in sys.modules:
|
||||||
importlib.reload(sys.modules['constants'])
|
importlib.reload(sys.modules['constants'])
|
||||||
else:
|
else:
|
||||||
import constants
|
import src.constants
|
||||||
|
|
||||||
assert constants.LOG_CLEAR == "True"
|
assert src.constants.LOG_CLEAR == "True"
|
||||||
|
|
||||||
def test_custom_log_clear_false(self):
|
def test_custom_log_clear_false(self):
|
||||||
"""Test LOG_CLEAR when set to false in environment."""
|
"""Test LOG_CLEAR when set to false in environment."""
|
||||||
@@ -86,9 +86,9 @@ class TestConstants:
|
|||||||
if 'constants' in sys.modules:
|
if 'constants' in sys.modules:
|
||||||
importlib.reload(sys.modules['constants'])
|
importlib.reload(sys.modules['constants'])
|
||||||
else:
|
else:
|
||||||
import constants
|
import src.constants
|
||||||
|
|
||||||
assert constants.LOG_CLEAR == "False"
|
assert src.constants.LOG_CLEAR == "False"
|
||||||
|
|
||||||
def test_log_level_case_insensitive(self):
|
def test_log_level_case_insensitive(self):
|
||||||
"""Test that LOG_LEVEL is converted to uppercase."""
|
"""Test that LOG_LEVEL is converted to uppercase."""
|
||||||
@@ -97,9 +97,9 @@ class TestConstants:
|
|||||||
if 'constants' in sys.modules:
|
if 'constants' in sys.modules:
|
||||||
importlib.reload(sys.modules['constants'])
|
importlib.reload(sys.modules['constants'])
|
||||||
else:
|
else:
|
||||||
import constants
|
import src.constants
|
||||||
|
|
||||||
assert constants.LOG_LEVEL == "WARNING"
|
assert src.constants.LOG_LEVEL == "WARNING"
|
||||||
|
|
||||||
def test_dotenv_override(self):
|
def test_dotenv_override(self):
|
||||||
"""Test that dotenv override parameter is set to True."""
|
"""Test that dotenv override parameter is set to True."""
|
||||||
@@ -109,22 +109,22 @@ class TestConstants:
|
|||||||
if 'constants' in sys.modules:
|
if 'constants' in sys.modules:
|
||||||
importlib.reload(sys.modules['constants'])
|
importlib.reload(sys.modules['constants'])
|
||||||
else:
|
else:
|
||||||
import constants
|
import src.constants
|
||||||
|
|
||||||
mock_load_dotenv.assert_called_once_with(override=True)
|
mock_load_dotenv.assert_called_once_with(override=True)
|
||||||
|
|
||||||
def test_all_constants_are_strings(self):
|
def test_all_constants_are_strings(self):
|
||||||
"""Test that all constants are string type."""
|
"""Test that all constants are string type."""
|
||||||
import constants
|
import src.constants
|
||||||
|
|
||||||
assert isinstance(constants.LOG_LEVEL, str)
|
assert isinstance(src.constants.LOG_LEVEL, str)
|
||||||
assert isinstance(constants.LOG_PATH, str)
|
assert isinstance(src.constants.LOG_PATH, str)
|
||||||
assert isinstance(constants.LOG_CLEAR, str)
|
assert isinstance(src.constants.LOG_CLEAR, str)
|
||||||
|
|
||||||
def test_constants_not_empty(self):
|
def test_constants_not_empty(self):
|
||||||
"""Test that constants are not empty strings."""
|
"""Test that constants are not empty strings."""
|
||||||
import constants
|
import src.constants
|
||||||
|
|
||||||
assert constants.LOG_LEVEL != ""
|
assert src.constants.LOG_LEVEL != ""
|
||||||
assert constants.LOG_PATH != ""
|
assert src.constants.LOG_PATH != ""
|
||||||
assert constants.LOG_CLEAR != ""
|
assert src.constants.LOG_CLEAR != ""
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import matplotlib.pyplot as plt
|
|||||||
import sys
|
import sys
|
||||||
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', 'src'))
|
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', 'src'))
|
||||||
|
|
||||||
from graph_manager import GraphManager
|
from src.graph_manager import GraphManager
|
||||||
|
|
||||||
|
|
||||||
class TestGraphManager:
|
class TestGraphManager:
|
||||||
|
|||||||
+19
-19
@@ -24,7 +24,7 @@ class TestInit:
|
|||||||
if 'init' in sys.modules:
|
if 'init' in sys.modules:
|
||||||
importlib.reload(sys.modules['init'])
|
importlib.reload(sys.modules['init'])
|
||||||
else:
|
else:
|
||||||
import init
|
import src.init
|
||||||
|
|
||||||
mock_mkdir.assert_called_once()
|
mock_mkdir.assert_called_once()
|
||||||
|
|
||||||
@@ -38,7 +38,7 @@ class TestInit:
|
|||||||
if 'init' in sys.modules:
|
if 'init' in sys.modules:
|
||||||
importlib.reload(sys.modules['init'])
|
importlib.reload(sys.modules['init'])
|
||||||
else:
|
else:
|
||||||
import init
|
import src.init
|
||||||
|
|
||||||
mock_mkdir.assert_not_called()
|
mock_mkdir.assert_not_called()
|
||||||
|
|
||||||
@@ -53,7 +53,7 @@ class TestInit:
|
|||||||
if 'init' in sys.modules:
|
if 'init' in sys.modules:
|
||||||
importlib.reload(sys.modules['init'])
|
importlib.reload(sys.modules['init'])
|
||||||
else:
|
else:
|
||||||
import init
|
import src.init
|
||||||
|
|
||||||
mock_print.assert_called()
|
mock_print.assert_called()
|
||||||
|
|
||||||
@@ -70,7 +70,7 @@ class TestInit:
|
|||||||
if 'init' in sys.modules:
|
if 'init' in sys.modules:
|
||||||
importlib.reload(sys.modules['init'])
|
importlib.reload(sys.modules['init'])
|
||||||
else:
|
else:
|
||||||
import init
|
import src.init
|
||||||
|
|
||||||
mock_init_logger.assert_called_once_with('init', testing_mode=False)
|
mock_init_logger.assert_called_once_with('init', testing_mode=False)
|
||||||
|
|
||||||
@@ -87,7 +87,7 @@ class TestInit:
|
|||||||
if 'init' in sys.modules:
|
if 'init' in sys.modules:
|
||||||
importlib.reload(sys.modules['init'])
|
importlib.reload(sys.modules['init'])
|
||||||
else:
|
else:
|
||||||
import init
|
import src.init
|
||||||
|
|
||||||
mock_init_logger.assert_called_once_with('init', testing_mode=True)
|
mock_init_logger.assert_called_once_with('init', testing_mode=True)
|
||||||
|
|
||||||
@@ -98,7 +98,7 @@ class TestInit:
|
|||||||
if 'init' in sys.modules:
|
if 'init' in sys.modules:
|
||||||
importlib.reload(sys.modules['init'])
|
importlib.reload(sys.modules['init'])
|
||||||
else:
|
else:
|
||||||
import init
|
import src.init
|
||||||
|
|
||||||
expected_files = (
|
expected_files = (
|
||||||
f"{temp_log_dir}/thechart.log",
|
f"{temp_log_dir}/thechart.log",
|
||||||
@@ -106,7 +106,7 @@ class TestInit:
|
|||||||
f"{temp_log_dir}/thechart.error.log",
|
f"{temp_log_dir}/thechart.error.log",
|
||||||
)
|
)
|
||||||
|
|
||||||
assert init.log_files == expected_files
|
assert src.init.log_files == expected_files
|
||||||
|
|
||||||
def test_testing_mode_detection(self, temp_log_dir):
|
def test_testing_mode_detection(self, temp_log_dir):
|
||||||
"""Test that testing mode is detected correctly."""
|
"""Test that testing mode is detected correctly."""
|
||||||
@@ -117,14 +117,14 @@ class TestInit:
|
|||||||
if 'init' in sys.modules:
|
if 'init' in sys.modules:
|
||||||
importlib.reload(sys.modules['init'])
|
importlib.reload(sys.modules['init'])
|
||||||
else:
|
else:
|
||||||
import init
|
import src.init
|
||||||
|
|
||||||
assert init.testing_mode is True
|
assert src.init.testing_mode is True
|
||||||
|
|
||||||
# Test with non-DEBUG level
|
# Test with non-DEBUG level
|
||||||
with patch('init.LOG_LEVEL', 'INFO'):
|
with patch('init.LOG_LEVEL', 'INFO'):
|
||||||
importlib.reload(sys.modules['init'])
|
importlib.reload(sys.modules['init'])
|
||||||
assert init.testing_mode is False
|
assert src.init.testing_mode is False
|
||||||
|
|
||||||
def test_log_clear_true(self, temp_log_dir):
|
def test_log_clear_true(self, temp_log_dir):
|
||||||
"""Test log file clearing when LOG_CLEAR is True."""
|
"""Test log file clearing when LOG_CLEAR is True."""
|
||||||
@@ -147,7 +147,7 @@ class TestInit:
|
|||||||
if 'init' in sys.modules:
|
if 'init' in sys.modules:
|
||||||
importlib.reload(sys.modules['init'])
|
importlib.reload(sys.modules['init'])
|
||||||
else:
|
else:
|
||||||
import init
|
import src.init
|
||||||
|
|
||||||
# Check that files were truncated
|
# Check that files were truncated
|
||||||
for log_file in log_files:
|
for log_file in log_files:
|
||||||
@@ -176,7 +176,7 @@ class TestInit:
|
|||||||
if 'init' in sys.modules:
|
if 'init' in sys.modules:
|
||||||
importlib.reload(sys.modules['init'])
|
importlib.reload(sys.modules['init'])
|
||||||
else:
|
else:
|
||||||
import init
|
import src.init
|
||||||
|
|
||||||
# Check that files were not truncated
|
# Check that files were not truncated
|
||||||
for log_file in log_files:
|
for log_file in log_files:
|
||||||
@@ -203,7 +203,7 @@ class TestInit:
|
|||||||
if 'init' in sys.modules:
|
if 'init' in sys.modules:
|
||||||
importlib.reload(sys.modules['init'])
|
importlib.reload(sys.modules['init'])
|
||||||
else:
|
else:
|
||||||
import init
|
import src.init
|
||||||
|
|
||||||
def test_log_clear_permission_error(self, temp_log_dir):
|
def test_log_clear_permission_error(self, temp_log_dir):
|
||||||
"""Test handling of permission errors during log clearing."""
|
"""Test handling of permission errors during log clearing."""
|
||||||
@@ -226,7 +226,7 @@ class TestInit:
|
|||||||
if 'init' in sys.modules:
|
if 'init' in sys.modules:
|
||||||
importlib.reload(sys.modules['init'])
|
importlib.reload(sys.modules['init'])
|
||||||
else:
|
else:
|
||||||
import init
|
import src.init
|
||||||
|
|
||||||
def test_module_exports(self, temp_log_dir):
|
def test_module_exports(self, temp_log_dir):
|
||||||
"""Test that module exports expected objects."""
|
"""Test that module exports expected objects."""
|
||||||
@@ -235,12 +235,12 @@ class TestInit:
|
|||||||
if 'init' in sys.modules:
|
if 'init' in sys.modules:
|
||||||
importlib.reload(sys.modules['init'])
|
importlib.reload(sys.modules['init'])
|
||||||
else:
|
else:
|
||||||
import init
|
import src.init
|
||||||
|
|
||||||
# Check that expected objects are available
|
# Check that expected objects are available
|
||||||
assert hasattr(init, 'logger')
|
assert hasattr(src.init, 'logger')
|
||||||
assert hasattr(init, 'log_files')
|
assert hasattr(src.init, 'log_files')
|
||||||
assert hasattr(init, 'testing_mode')
|
assert hasattr(src.init, 'testing_mode')
|
||||||
|
|
||||||
def test_log_path_printing(self, temp_log_dir):
|
def test_log_path_printing(self, temp_log_dir):
|
||||||
"""Test that LOG_PATH is printed when directory is created."""
|
"""Test that LOG_PATH is printed when directory is created."""
|
||||||
@@ -253,6 +253,6 @@ class TestInit:
|
|||||||
if 'init' in sys.modules:
|
if 'init' in sys.modules:
|
||||||
importlib.reload(sys.modules['init'])
|
importlib.reload(sys.modules['init'])
|
||||||
else:
|
else:
|
||||||
import init
|
import src.init
|
||||||
|
|
||||||
mock_print.assert_called_with(temp_log_dir + '/new_dir')
|
mock_print.assert_called_with(temp_log_dir + '/new_dir')
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ from unittest.mock import patch, Mock
|
|||||||
import sys
|
import sys
|
||||||
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', 'src'))
|
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', 'src'))
|
||||||
|
|
||||||
from logger import init_logger
|
from src.logger import init_logger
|
||||||
|
|
||||||
|
|
||||||
class TestLogger:
|
class TestLogger:
|
||||||
|
|||||||
+1
-1
@@ -10,7 +10,7 @@ import pandas as pd
|
|||||||
import sys
|
import sys
|
||||||
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', 'src'))
|
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', 'src'))
|
||||||
|
|
||||||
from main import MedTrackerApp
|
from src.main import MedTrackerApp
|
||||||
|
|
||||||
|
|
||||||
class TestMedTrackerApp:
|
class TestMedTrackerApp:
|
||||||
|
|||||||
Reference in New Issue
Block a user