-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Adds some coverage to dfbuyer agent. * Add dfbuyer and ppss coverage. * Adds predictoor and sim coverage. * Adds coverage to util. * Add some trueval coverage. * Adds coverage to trader agents. * Add coverage to portfolio. * Add coverage to subgraph consume_so_far and fix an infinite loop bug. * More subgraph coverage.
- Loading branch information
Showing
40 changed files
with
608 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
pdr_backend/predictoor/approach1/test/test_predictoor_agent1.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,35 @@ | ||
from unittest.mock import MagicMock | ||
|
||
import pytest | ||
from enforce_typing import enforce_types | ||
|
||
from pdr_backend.ppss.ppss import PPSS | ||
from pdr_backend.ppss.predictoor_ss import PredictoorSS | ||
from pdr_backend.ppss.web3_pp import Web3PP | ||
from pdr_backend.predictoor.approach1.predictoor_agent1 import PredictoorAgent1 | ||
from pdr_backend.predictoor.test.predictoor_agent_runner import run_agent_test | ||
|
||
|
||
def test_predictoor_agent1(tmpdir, monkeypatch): | ||
run_agent_test(str(tmpdir), monkeypatch, PredictoorAgent1) | ||
|
||
|
||
def test_run(): | ||
mock_predictoor_agent1 = MagicMock(spec=PredictoorAgent1) | ||
take_step = mock_predictoor_agent1.take_step | ||
take_step.return_value = None | ||
|
||
mock_predictoor_agent1.run() | ||
|
||
|
||
@enforce_types | ||
def test_agent_constructor_empty(): | ||
# test with no feeds | ||
mock_ppss_empty = MagicMock(spec=PPSS) | ||
mock_ppss_empty.predictoor_ss = MagicMock(spec=PredictoorSS) | ||
mock_ppss_empty.predictoor_ss.get_feed_from_candidates.return_value = None | ||
mock_ppss_empty.web3_pp = MagicMock(spec=Web3PP) | ||
mock_ppss_empty.web3_pp.query_feed_contracts.return_value = {} | ||
|
||
with pytest.raises(ValueError, match="No feeds found"): | ||
PredictoorAgent1(mock_ppss_empty) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.