move telegram fixture to telegram file

This commit is contained in:
Matthias 2023-01-02 10:55:55 +01:00
parent da261003df
commit c37b7b77e4
2 changed files with 9 additions and 9 deletions

View File

@ -3,7 +3,7 @@ import json
import logging
import re
from copy import deepcopy
from datetime import datetime, timedelta
from datetime import timedelta
from pathlib import Path
from typing import Optional
from unittest.mock import MagicMock, Mock, PropertyMock
@ -12,7 +12,6 @@ import arrow
import numpy as np
import pandas as pd
import pytest
from telegram import Chat, Message, Update
from freqtrade import constants
from freqtrade.commands import Arguments
@ -550,13 +549,6 @@ def get_default_conf_usdt(testdatadir):
return configuration
@pytest.fixture
def update():
_update = Update(0)
_update.message = Message(0, datetime.utcnow(), Chat(0, 0))
return _update
@pytest.fixture
def fee():
return MagicMock(return_value=0.0025)

View File

@ -43,6 +43,14 @@ def default_conf(default_conf) -> dict:
return default_conf
@pytest.fixture
def update():
message = Message(0, datetime.utcnow(), Chat(0, 0))
_update = Update(0, message=message)
return _update
class DummyCls(Telegram):
"""
Dummy class for testing the Telegram @authorized_only decorator