|
1
|
|
|
"""Tests the logging of Operation and Daytrade objects.""" |
|
2
|
|
|
|
|
3
|
|
|
from __future__ import absolute_import |
|
4
|
|
|
|
|
5
|
|
|
from tests.fixtures.logtest import LogTest |
|
6
|
|
|
from tests.fixtures.operations import ( |
|
7
|
|
|
OPERATION1, OPERATION18, DAYTRADE0, DAYTRADE1, |
|
8
|
|
|
) |
|
9
|
|
|
from tests.fixtures.logs import ( |
|
10
|
|
|
EXPECTED_LOG19, EXPECTED_LOG23, EXPECTED_LOG21, |
|
11
|
|
|
) |
|
12
|
|
|
from tests.fixtures.accumulator_states import ( |
|
13
|
|
|
EXPECTED_STATE23, EXPECTED_STATE24, |
|
14
|
|
|
) |
|
15
|
|
|
|
|
16
|
|
|
|
|
17
|
|
|
class TestLogDaytradesAndOperationsCase00(LogTest): |
|
18
|
|
|
"""Tests the logging of Operation and Daytrade objects. |
|
19
|
|
|
|
|
20
|
|
|
This test creates a position. |
|
21
|
|
|
""" |
|
22
|
|
|
|
|
23
|
|
|
occurrences = [DAYTRADE0, OPERATION18] |
|
24
|
|
|
expected_log = EXPECTED_LOG19 |
|
25
|
|
|
expected_state = EXPECTED_STATE23 |
|
26
|
|
|
|
|
27
|
|
|
|
|
28
|
|
|
class TestLogDaytradesAndOperationsCase01(LogTest): |
|
29
|
|
|
"""Tests the logging of Operation and Daytrade objects.""" |
|
30
|
|
|
|
|
31
|
|
|
occurrences = [DAYTRADE0, OPERATION1, DAYTRADE1] |
|
32
|
|
|
expected_log = EXPECTED_LOG21 |
|
33
|
|
|
expected_state = EXPECTED_STATE24 |
|
34
|
|
|
|
|
35
|
|
|
|
|
36
|
|
|
class TestLogDaytradesAndOperationsCase02(LogTest): |
|
37
|
|
|
"""Tests the logging of Operation and Daytrade objects.""" |
|
38
|
|
|
|
|
39
|
|
|
occurrences = [DAYTRADE0, OPERATION1] |
|
40
|
|
|
expected_log = EXPECTED_LOG23 |
|
41
|
|
|
expected_state = EXPECTED_STATE23 |
|
42
|
|
|
|