Skip to content

Commit

Permalink
remove nonsense asserts
Browse files Browse the repository at this point in the history
  • Loading branch information
vertti committed Jul 29, 2018
1 parent 4202413 commit 1bbb86c
Show file tree
Hide file tree
Showing 7 changed files with 0 additions and 98 deletions.
6 changes: 0 additions & 6 deletions freqtrade/tests/rpc/test_rpc_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,6 @@
from freqtrade.tests.conftest import log_has, get_patched_freqtradebot


def test_rpc_manager_object() -> None:
""" Test the Arguments object has the mandatory methods """
assert hasattr(RPCManager, 'send_msg')
assert hasattr(RPCManager, 'cleanup')


def test__init__(mocker, default_conf) -> None:
""" Test __init__() method """
conf = deepcopy(default_conf)
Expand Down
12 changes: 0 additions & 12 deletions freqtrade/tests/strategy/test_strategy.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ def test_search_strategy():

def test_load_strategy(result):
resolver = StrategyResolver({'strategy': 'TestStrategy'})
assert hasattr(resolver.strategy, 'populate_indicators')
assert 'adx' in resolver.strategy.populate_indicators(result)


Expand All @@ -71,8 +70,6 @@ def test_load_strategy_invalid_directory(result, caplog):
logging.WARNING,
'Path "{}" does not exist'.format(extra_dir),
) in caplog.record_tuples

assert hasattr(resolver.strategy, 'populate_indicators')
assert 'adx' in resolver.strategy.populate_indicators(result)


Expand All @@ -89,26 +86,20 @@ def test_strategy(result):

resolver = StrategyResolver(config)

assert hasattr(resolver.strategy, 'minimal_roi')
assert resolver.strategy.minimal_roi[0] == 0.04
assert config["minimal_roi"]['0'] == 0.04

assert hasattr(resolver.strategy, 'stoploss')
assert resolver.strategy.stoploss == -0.10
assert config['stoploss'] == -0.10

assert hasattr(resolver.strategy, 'ticker_interval')
assert resolver.strategy.ticker_interval == '5m'
assert config['ticker_interval'] == '5m'

assert hasattr(resolver.strategy, 'populate_indicators')
assert 'adx' in resolver.strategy.populate_indicators(result)

assert hasattr(resolver.strategy, 'populate_buy_trend')
dataframe = resolver.strategy.populate_buy_trend(resolver.strategy.populate_indicators(result))
assert 'buy' in dataframe.columns

assert hasattr(resolver.strategy, 'populate_sell_trend')
dataframe = resolver.strategy.populate_sell_trend(resolver.strategy.populate_indicators(result))
assert 'sell' in dataframe.columns

Expand All @@ -123,7 +114,6 @@ def test_strategy_override_minimal_roi(caplog):
}
resolver = StrategyResolver(config)

assert hasattr(resolver.strategy, 'minimal_roi')
assert resolver.strategy.minimal_roi[0] == 0.5
assert ('freqtrade.strategy.resolver',
logging.INFO,
Expand All @@ -139,7 +129,6 @@ def test_strategy_override_stoploss(caplog):
}
resolver = StrategyResolver(config)

assert hasattr(resolver.strategy, 'stoploss')
assert resolver.strategy.stoploss == -0.5
assert ('freqtrade.strategy.resolver',
logging.INFO,
Expand All @@ -156,7 +145,6 @@ def test_strategy_override_ticker_interval(caplog):
}
resolver = StrategyResolver(config)

assert hasattr(resolver.strategy, 'ticker_interval')
assert resolver.strategy.ticker_interval == 60
assert ('freqtrade.strategy.resolver',
logging.INFO,
Expand Down
12 changes: 0 additions & 12 deletions freqtrade/tests/test_arguments.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,11 @@
from freqtrade.arguments import Arguments, TimeRange


def test_arguments_object() -> None:
"""
Test the Arguments object has the mandatory methods
:return: None
"""
assert hasattr(Arguments, 'get_parsed_arg')
assert hasattr(Arguments, 'parse_args')
assert hasattr(Arguments, 'parse_timerange')
assert hasattr(Arguments, 'scripts_options')


# Parse common command-line-arguments. Used for all tools
def test_parse_args_none() -> None:
arguments = Arguments([], '')
assert isinstance(arguments, Arguments)
assert isinstance(arguments.parser, argparse.ArgumentParser)
assert isinstance(arguments.parser, argparse.ArgumentParser)


def test_parse_args_defaults() -> None:
Expand Down
13 changes: 0 additions & 13 deletions freqtrade/tests/test_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,6 @@
from freqtrade.tests.conftest import log_has


def test_configuration_object() -> None:
"""
Test the Constants object has the mandatory Constants
"""
assert hasattr(Configuration, 'load_config')
assert hasattr(Configuration, '_load_config_file')
assert hasattr(Configuration, '_validate_config')
assert hasattr(Configuration, '_load_common_config')
assert hasattr(Configuration, '_load_backtesting_config')
assert hasattr(Configuration, '_load_hyperopt_config')
assert hasattr(Configuration, 'get_config')


def test_load_config_invalid_pair(default_conf) -> None:
"""
Test the configuration validator with an invalid PAIR format
Expand Down
25 changes: 0 additions & 25 deletions freqtrade/tests/test_constants.py

This file was deleted.

16 changes: 0 additions & 16 deletions freqtrade/tests/test_freqtradebot.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,22 +62,6 @@ def patch_RPCManager(mocker) -> MagicMock:


# Unit tests
def test_freqtradebot_object() -> None:
"""
Test the FreqtradeBot object has the mandatory public methods
"""
assert hasattr(FreqtradeBot, 'worker')
assert hasattr(FreqtradeBot, 'cleanup')
assert hasattr(FreqtradeBot, 'create_trade')
assert hasattr(FreqtradeBot, 'get_target_bid')
assert hasattr(FreqtradeBot, 'process_maybe_execute_buy')
assert hasattr(FreqtradeBot, 'process_maybe_execute_sell')
assert hasattr(FreqtradeBot, 'handle_trade')
assert hasattr(FreqtradeBot, 'check_handle_timedout')
assert hasattr(FreqtradeBot, 'handle_timedout_limit_buy')
assert hasattr(FreqtradeBot, 'handle_timedout_limit_sell')
assert hasattr(FreqtradeBot, 'execute_sell')


def test_freqtradebot(mocker, default_conf) -> None:
"""
Expand Down
14 changes: 0 additions & 14 deletions freqtrade/tests/test_state.py

This file was deleted.

0 comments on commit 1bbb86c

Please sign in to comment.