1
0
mirror of https://github.com/Rikj000/MoniGoMani.git synced 2022-03-06 00:08:05 +03:00

Fixing unit tests. Period.

This commit is contained in:
topscoder
2021-08-15 21:27:01 +02:00
parent 0c486f3a45
commit 2443f64c51
5 changed files with 9 additions and 49 deletions

View File

@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
import sys
import pytest
from unittest.mock import MagicMock
sys.path.append('.')
sys.path.append('..')
@@ -139,4 +140,6 @@ def test_installation_exists_install_type_docker():
# --- ↓
def __get_instance(directory: str):
"""Create instance of freqtradecli."""
return FreqtradeCli(directory)
fc = FreqtradeCli(directory)
fc.cli_logger = MagicMock()
return fc

View File

@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
import os
from logging import Logger
from unittest.mock import MagicMock, patch
from unittest.mock import MagicMock
import pytest
import sys
@@ -9,7 +9,6 @@ sys.path.append('.')
sys.path.append('..')
from user_data.mgm_tools.mgm_hurry.MoniGoManiCli import MoniGoManiCli
from user_data.mgm_tools.mgm_hurry.MoniGoManiLogger import MoniGoManiLogger
def test_initialisation():
@@ -86,13 +85,10 @@ def test_run_command():
# --- ↓
# --- ↓ Helper methods
# --- ↓
@patch('MoniGoManiLogger.logging')
@patch('MoniGoManiLogger.logger')
def __get_instance(basedir='.'):
cli = MoniGoManiCli(basedir)
cli.cli_logger = MagicMock()
return cli
@patch('MoniGoManiLogger.logging')
@patch('MoniGoManiLogger.logger')
def __get_logger(basedir='.') -> Logger:
return MoniGoManiLogger(basedir).get_logger()
return MagicMock()

View File

@@ -2,13 +2,10 @@
import sys
import pytest
from unittest.mock import patch
sys.path.append('.')
sys.path.append('..')
from user_data.mgm_tools.mgm_hurry.MoniGoManiConfig import MoniGoManiConfig
from user_data.mgm_tools.mgm_hurry.MoniGoManiLogger import MoniGoManiLogger
def test_initialisation():
@@ -73,38 +70,6 @@ def test_read_hurry_config():
# --- ↑
# --- ↓
# --- ↓ Unit Testing "get_config_filename"
# --- ↓
@pytest.mark.skip(reason='Test not implemented.')
def test_get_config_filename():
assert NotImplemented
# --- ↑
# --- ↓
# --- ↓ Unit Testing "load_config_files"
# --- ↓
@pytest.mark.skip(reason='Test not implemented.')
def test_load_config_files():
assert NotImplemented
# --- ↑
# --- ↓
# --- ↓ Unit Testing "read_hurry_config"
# --- ↓
@pytest.mark.skip(reason='Test not implemented.')
def test_read_hurry_config():
assert NotImplemented
# --- ↑
# --- ↓
# --- ↓ Unit Testing "get_config_filename"
# --- ↓
@@ -141,10 +106,7 @@ def test_write():
# --- ↓
# --- ↓ Helper methods
# --- ↓
@patch('MoniGoManiLogger.logging')
@patch('MoniGoManiLogger.logger')
def __get_instance():
basedir = '.'
obj = MoniGoManiConfig(basedir)
return obj

View File

@@ -1,6 +1,5 @@
# -*- coding: utf-8 -*-
import sys
import pytest
sys.path.append('.')
sys.path.append('..')