atkinson / wagmi

An execution framework for systematic strategies
BSD 2-Clause "Simplified" License
10 stars 12 forks source link

Tests - we need pytests #5

Closed atkinson closed 2 years ago

atkinson commented 2 years ago

Nothing crazy, just something to run through the install and execute the strategies (via management commands) without actually hitting exchanges.

atkinson commented 2 years ago

Let's just add end-to-end style tests for now, we can add unit tests after we get something reasonably close to a working version.

CC @arnaudj

arnaudj commented 2 years ago

Yes, works for me @atkinson

For my info, any idea how this would look like? eg, trigger a strategy via manage.py, run in dry/test mode, then: assert DB entries? (StrategyPositionRequest, TargetPosition)

Should we consider to mock something? I'll read up on django testing best practices.

atkinson commented 2 years ago

Probably simplest to use this: https://pytest-django.readthedocs.io/en/latest/

... and invoke strategies programmatically.

Can invoke management commands programmatically as well if you like, e.g:

from django.core import management
management.call_command("rw_yolo", "param1")