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

Add test_parse_ignore function to test_cex_exchange_plugin.py #912

Merged
merged 17 commits into from
Oct 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .github/.mergify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
pull_request_rules:
- name: Automatic merge on approval
conditions:
- "check-success=build"
- "check-success=test"
- "#check-failure=0"
actions:
merge:
method: merge
22 changes: 12 additions & 10 deletions .github/.pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.0.291
rev: v0.0.292
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]

- repo: https://github.com/psf/black-pre-commit-mirror
rev: 23.9.1
hooks:
- id: black
language_version: python3.11

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-merge-conflict
- id: check-toml
- id: trailing-whitespace
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
rev: v2.10.0

- repo: https://github.com/PyCQA/bandit
rev: '1.7.5'
hooks:
- id: pretty-format-toml
args: [--autofix]
# - repo: https://github.com/pre-commit/mirrors-prettier
# rev: '' # Use the sha / tag you want to point at
# hooks:
# - id: prettier
- id: bandit
args: ["-c", "pyproject.toml"]
14 changes: 7 additions & 7 deletions .requirements/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ blurhash==1.1.4 ; python_version >= "3.10" and python_version < "4.0"
brotli==1.1.0 ; platform_python_implementation == "CPython" and python_version >= "3.10" and python_version < "4.0"
brotlicffi==1.1.0.0 ; platform_python_implementation != "CPython" and python_version >= "3.10" and python_version < "4.0"
browser-cookie3==0.19.1 ; python_version >= "3.10" and python_version < "4.0"
ccxt==4.1.1 ; python_version >= "3.10" and python_version < "4.0"
cefi==3.1.4 ; python_version >= "3.10" and python_version < "4.0"
ccxt==4.1.9 ; python_version >= "3.10" and python_version < "4.0"
cefi==3.1.6 ; python_version >= "3.10" and python_version < "4.0"
certifi==2023.7.22 ; python_version >= "3.10" and python_version < "4.0"
cffi==1.16.0 ; python_version >= "3.10" and python_version < "4.0"
charset-normalizer==3.3.0 ; python_version >= "3.10" and python_version < "4.0"
Expand All @@ -32,7 +32,7 @@ curl-cffi==0.5.7 ; python_version >= "3.10" and python_version < "4.0"
cytoolz==0.12.2 ; python_version >= "3.10" and python_version < "4" and implementation_name == "cpython"
decorator==5.1.1 ; python_version >= "3.10" and python_version < "4.0"
duckduckgo-search==3.8.5 ; python_version >= "3.10" and python_version < "4.0"
dxsp==5.2.6 ; python_version >= "3.10" and python_version < "4.0"
dxsp==5.2.8 ; python_version >= "3.10" and python_version < "4.0"
dynaconf==3.2.3 ; python_version >= "3.10" and python_version < "4.0"
eth-abi==4.2.1 ; python_version >= "3.10" and python_version < "4"
eth-account==0.9.0 ; python_version >= "3.10" and python_version < "4"
Expand All @@ -46,7 +46,7 @@ eth-utils==2.2.1 ; python_version >= "3.10" and python_version < "4"
exceptiongroup==1.1.3 ; python_version >= "3.10" and python_version < "3.11"
fastapi-socketio==0.0.10 ; python_version >= "3.10" and python_version < "4.0"
fastapi==0.95.2 ; python_version >= "3.10" and python_version < "4.0"
findmyorder==1.8.0 ; python_version >= "3.10" and python_version < "4.0"
findmyorder==1.8.2 ; python_version >= "3.10" and python_version < "4.0"
flask-cors==4.0.0 ; python_version >= "3.10" and python_version < "4.0"
flask==3.0.0 ; python_version >= "3.10" and python_version < "4.0"
frozendict==2.3.8 ; python_version >= "3.10" and python_version < "4.0"
Expand All @@ -66,7 +66,7 @@ httptools==0.6.0 ; python_version >= "3.10" and python_version < "4.0"
httpx==0.24.1 ; python_version >= "3.10" and python_version < "4.0"
httpx[brotli,http2,socks]==0.24.1 ; python_version >= "3.10" and python_version < "4.0"
hyperframe==6.0.1 ; python_version >= "3.10" and python_version < "4.0"
iamlistening==4.2.8 ; python_version >= "3.10" and python_version < "4.0"
iamlistening==4.2.10 ; python_version >= "3.10" and python_version < "4.0"
idna==3.4 ; python_version >= "3.10" and python_version < "4.0"
iso8601==2.1.0 ; python_version >= "3.10" and python_version < "4.0"
itsdangerous==2.1.2 ; python_version >= "3.10" and python_version < "4.0"
Expand All @@ -88,7 +88,7 @@ mastodon-py==1.8.1 ; python_version >= "3.10" and python_version < "4.0"
matrix-nio==0.20.2 ; python_version >= "3.10" and python_version < "4.0"
multidict==6.0.4 ; python_version >= "3.10" and python_version < "4.0"
multitasking==0.0.11 ; python_version >= "3.10" and python_version < "4.0"
myllm==3.1.17 ; python_version >= "3.10" and python_version < "4.0"
myllm==3.1.19 ; python_version >= "3.10" and python_version < "4.0"
nicegui==1.3.16 ; python_version >= "3.10" and python_version < "4.0"
numpy==1.25.2 ; python_version >= "3.10" and python_version < "4.0"
oauthlib==3.2.2 ; python_version >= "3.10" and python_version < "4.0"
Expand Down Expand Up @@ -148,7 +148,7 @@ sniffio==1.3.0 ; python_version >= "3.10" and python_version < "4.0"
socksio==1.0.0 ; python_version >= "3.10" and python_version < "4.0"
soupsieve==2.5 ; python_version >= "3.10" and python_version < "4.0"
starlette==0.27.0 ; python_version >= "3.10" and python_version < "4.0"
talkytrend==1.15.1 ; python_version >= "3.10" and python_version < "4.0"
talkytrend==1.15.2 ; python_version >= "3.10" and python_version < "4.0"
telethon==1.30.3 ; python_version >= "3.10" and python_version < "4.0"
toml==0.10.2 ; python_version >= "3.10" and python_version < "4.0"
toolz==0.12.0 ; python_version >= "3.10" and python_version < "4" and (implementation_name == "pypy" or implementation_name == "cpython")
Expand Down
22 changes: 13 additions & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,19 @@ apprise = "^1.5.0"
asyncz = ">=0.3.1"
nicegui = "^1.3.15"
ping3 = "^4.0.4"
iamlistening = "4.2.8"
findmyorder = "1.8.0"
dxsp = "5.2.6"
cefi = "3.1.4"
talkytrend = "1.15.1"
myllm = "3.1.17"
talkytrend = "1.15.2"
iamlistening = "4.2.10"
findmyorder = "1.8.2"
dxsp = "5.2.8"
cefi = "3.1.6"
myllm = "3.1.19"


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

[tool.poetry.group.docs]
optional = true
Expand Down Expand Up @@ -112,8 +114,6 @@ exclude = [
"docs/*"
]
fixable = ["ALL"]
# ignore = ["E401","F401"]
#format = "github"
select = [
"E", # pycodestyle
"F", # pyflakes
Expand All @@ -133,6 +133,10 @@ omit = [
"*/config.py"
]

[tool.bandit]
exclude_dirs = ["tests","docs"]
skips = ["B101","B104"]


[tool.semantic_release]
build_command = "pip install poetry && poetry build"
Expand Down
10 changes: 10 additions & 0 deletions tests/test_cex_exchange_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,13 @@ async def test_parse_valid_order(plugin, order_message):
plugin.fmo.search.assert_awaited_once
plugin.fmo.get_order.assert_awaited_once
plugin.exchange.submit_order.assert_awaited


@pytest.mark.asyncio
async def test_parse_ignore(plugin):
"""Search Testing"""

result = await plugin.handle_message("🏦 balance")
assert result is None
Dismissed Show dismissed Hide dismissed


2 changes: 1 addition & 1 deletion tt/plugins/default_plugins/cex_exchange_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ async def handle_message(self, msg):
"""
if not self.should_handle(msg):
return
logger.debug("settings.bot_ignore: %s", settings.bot_ignore)
logger.debug("settings.bot_ignore: {}", settings.bot_ignore)
if not msg.startswith(settings.bot_ignore):
if await self.fmo.search(msg):
order = await self.fmo.get_order(msg)
Expand Down