cleanup the module structure a bit
This commit is contained in:
@@ -11,7 +11,7 @@ from subprocess import CalledProcessError
|
||||
import inotify.adapters
|
||||
from inotify.constants import IN_CLOSE_WRITE
|
||||
|
||||
from server import load_global_model, run_analysis
|
||||
from utils.analysis import load_global_model, run_analysis
|
||||
from utils.helpers import get_settings, get_wav_files, ANALYZING_NOW
|
||||
from utils.classes import ParseFileName
|
||||
from utils.reporting import extract_detection, summary, write_to_file, write_to_db, apprise, bird_weather, heartbeat, \
|
||||
|
||||
@@ -5,9 +5,9 @@ import time
|
||||
import librosa
|
||||
import numpy as np
|
||||
|
||||
from scripts.utils.classes import Detection, ParseFileName
|
||||
from scripts.utils.helpers import get_settings, get_language
|
||||
from scripts.utils.models import get_model
|
||||
from .classes import Detection, ParseFileName
|
||||
from .helpers import get_settings, get_language
|
||||
from .models import get_model
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
@@ -2,7 +2,7 @@ import os
|
||||
import unittest
|
||||
from unittest.mock import patch
|
||||
|
||||
from scripts.server import run_analysis
|
||||
from scripts.utils.analysis import run_analysis
|
||||
from scripts.utils.classes import ParseFileName
|
||||
from tests.helpers import TESTDATA, Settings
|
||||
|
||||
@@ -10,7 +10,7 @@ from tests.helpers import TESTDATA, Settings
|
||||
class TestRunAnalysis(unittest.TestCase):
|
||||
|
||||
@patch('scripts.utils.helpers._load_settings')
|
||||
@patch('scripts.server.loadCustomSpeciesList')
|
||||
@patch('scripts.utils.analysis.loadCustomSpeciesList')
|
||||
def test_run_analysis(self, mock_loadCustomSpeciesList, mock_load_settings):
|
||||
# Mock the settings and species list
|
||||
mock_load_settings.return_value = Settings.with_defaults()
|
||||
Reference in New Issue
Block a user