Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

♻️ pyproject update ✅ Unit Test #308

Merged
merged 14 commits into from
Oct 10, 2023
16 changes: 10 additions & 6 deletions findmyorder/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"""
from datetime import datetime

from loguru import logger
from pyparsing import (
Combine,
Optional,
Expand Down Expand Up @@ -43,12 +42,17 @@ class FindMyOrder:
def __init__(
self,
):
self.logger = logger
"""
Initializes the class instance.

async def search(
self,
my_string: str,
) -> bool:
Args:
self (ClassName): The class instance.

Returns:
None
"""

async def search(self, my_string: str) -> bool:
"""
Search an order.

Expand Down
17 changes: 12 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@ pyparsing = "^3.0.9"


[tool.poetry.group.dev.dependencies]
python-semantic-release = "^8.0.7"
ruff = "*"
python-semantic-release = ">=8.0.8"
ruff = "^0.0.265"
black = "^23.3.0"
pre-commit = "^3.3.1"

[tool.ruff]
select = [
Expand All @@ -43,8 +45,7 @@ exclude = [
".github/*",
"docs/*",
]
ignore = ["E401","F401","F811"]
format = "github"

fixable = ["ALL"]

[tool.pylint.exceptions]
Expand All @@ -64,7 +65,7 @@ pytest = "^7.0"
pytest-cov = "^4.1"
pytest-asyncio = "^0.21.0"
pytest-mock = "^3.11.1"
pytest-loguru = "^0.2.0"
pytest-loguru = "^0.3.0"



Expand Down Expand Up @@ -97,6 +98,12 @@ omit = [
"*/config.py"
]

[tool.bandit]
exclude_dirs = ["tests","docs"]

[tool.bandit.assert_used]
skips = ["*_test.py", "test_*.py"]

[tool.semantic_release]
upload_to_vcs_release = true
version_variables = ["findmyorder/__init__.py:__version__"]
Expand Down
29 changes: 29 additions & 0 deletions tests/test_unit.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,28 @@
return "Buy EURUSD"


@pytest.fixture
def order_2():
"""return order 2"""
return """
📊 FUTURES Exchanges: Binance, ByBit USDT

#AAVEUSDT

🟢LONG ENTRY :- 65.20 - 63.70

Leverage: Cross (2X)

👇TAKE PROFIT

1) 65.70
2) 66.20
3) 66.70

Stop Loss : - 62.00
"""


@pytest.fixture
def result_order():
"""return standard expected results"""
Expand Down Expand Up @@ -217,3 +239,10 @@
assert settings.instrument_mapping is True
assert result["instrument"] == result_crypto_order["instrument"]
assert type(result["timestamp"] is datetime)


@pytest.mark.asyncio
async def test_identify_order2(fmo, order_2):
"""Identify Testing"""
result = await fmo.identify_order(order_2)
assert result is not None
Fixed Show fixed Hide fixed
Fixed Show fixed Hide fixed

Check notice

Code scanning / Bandit

Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. Note test

Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
Loading