Skip to content

Commit f27fd04

Browse files
authored
Fix existing tests for tests currently used (#139)
This PR fixes some broken e2e tests for the tests that are currently used for monitoring
1 parent eb522f3 commit f27fd04

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

src/monitoring_tests/base_test.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ class BaseTest(ABC):
2121
def __init__(self) -> None:
2222
self.tx_hashes: list[str] = []
2323
self.logger = get_logger()
24+
self.slack_client: WebClient | None = None
2425

2526
if "SLACK_BOT_TOKEN" in os.environ:
2627
self.slack_client = WebClient(token=os.environ["SLACK_BOT_TOKEN"])

tests/e2e/high_score_test.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,16 @@
33
"""
44

55
import unittest
6+
from src.apis.orderbookapi import OrderbookAPI
67
from src.monitoring_tests.high_score_test import (
78
HighScoreTest,
89
)
910

1011

1112
class TestHighScore(unittest.TestCase):
1213
def test_high_score(self) -> None:
13-
high_score_test = HighScoreTest()
14+
orderbook_api = OrderbookAPI("mainnet")
15+
high_score_test = HighScoreTest(orderbook_api)
1416
# large score tx
1517
tx_hash = "0x5eef22d04a2f30e62df76614decf43e1cc92ab957285a687f182a0191d85d15a"
1618
self.assertTrue(high_score_test.run(tx_hash))

tests/e2e/surplus_test.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,16 @@
33
"""
44

55
import unittest
6+
from src.apis.orderbookapi import OrderbookAPI
67
from src.monitoring_tests.solver_competition_surplus_test import (
78
SolverCompetitionSurplusTest,
89
)
910

1011

1112
class TestSurplus(unittest.TestCase):
1213
def test_surplus(self) -> None:
13-
surplus_test = SolverCompetitionSurplusTest()
14+
orderbook_api = OrderbookAPI("mainnet")
15+
surplus_test = SolverCompetitionSurplusTest(orderbook_api)
1416
# new competition format: no alert or info
1517
tx_hash = "0xc140a3adc9debfc00a45cc713afbac1bbe197ad2dd1d7fa5b4a36de1080a3d66"
1618
self.assertTrue(surplus_test.run(tx_hash))

0 commit comments

Comments
 (0)