-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
507 additions
and
199 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
13 changes: 13 additions & 0 deletions
13
tests/vega_query/service/service_trading_data/test_get_current_referral_program.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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import pytest | ||
|
||
from vega_query.service.service_trading_data import TradingDataService | ||
from tests.vega_query.fixtures import tds | ||
|
||
import vega_protos.protos as protos | ||
|
||
|
||
@pytest.mark.vega_query | ||
def test_get_current_referral_program(tds: TradingDataService): | ||
program = tds.get_current_referral_program() | ||
if program is not None: | ||
assert isinstance(program, protos.data_node.api.v2.trading_data.ReferralProgram) |
15 changes: 15 additions & 0 deletions
15
tests/vega_query/service/service_trading_data/test_get_current_volume_discount_program.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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import pytest | ||
|
||
from vega_query.service.service_trading_data import TradingDataService | ||
from tests.vega_query.fixtures import tds | ||
|
||
import vega_protos.protos as protos | ||
|
||
|
||
@pytest.mark.vega_query | ||
def test_get_latest_volume_discount_program(tds: TradingDataService): | ||
program = tds.get_current_volume_discount_program() | ||
if program is not None: | ||
assert isinstance( | ||
program, protos.data_node.api.v2.trading_data.VolumeDiscountProgram | ||
) |
15 changes: 15 additions & 0 deletions
15
tests/vega_query/service/service_trading_data/test_get_current_volume_rebate_program.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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import pytest | ||
|
||
from vega_query.service.service_trading_data import TradingDataService | ||
from tests.vega_query.fixtures import tds | ||
|
||
import vega_protos.protos as protos | ||
|
||
|
||
@pytest.mark.vega_query | ||
def test_get_latest_volume_rebate_program(tds: TradingDataService): | ||
program = tds.get_current_volume_rebate_program() | ||
if program is not None: | ||
assert isinstance( | ||
program, protos.data_node.api.v2.trading_data.VolumeRebateProgram | ||
) |
26 changes: 26 additions & 0 deletions
26
tests/vega_query/service/service_trading_data/test_get_epoch.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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import pytest | ||
|
||
from vega_query.service.service_trading_data import TradingDataService | ||
from tests.vega_query.fixtures import tds, epoch | ||
|
||
import vega_protos.protos as protos | ||
|
||
|
||
@pytest.mark.vega_query | ||
def test_get_epoch(tds: TradingDataService): | ||
epoch = tds.get_epoch() | ||
assert isinstance(epoch, protos.vega.vega.Epoch) | ||
|
||
|
||
@pytest.mark.vega_query | ||
def test_get_epoch_id(tds: TradingDataService, epoch: protos.vega.vega.Epoch): | ||
id = epoch.seq | ||
epoch = tds.get_epoch(id=id) | ||
assert epoch.seq == id | ||
|
||
|
||
@pytest.mark.vega_query | ||
def test_get_epoch_block(tds: TradingDataService, epoch: protos.vega.vega.Epoch): | ||
block = epoch.timestamps.first_block | ||
epoch = tds.get_epoch(block=block) | ||
assert epoch.timestamps.first_block == block |
Empty file.
32 changes: 32 additions & 0 deletions
32
tests/vega_query/service/service_trading_data/test_get_volume_discount_program_stats.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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import pytest | ||
|
||
from vega_query.service.service_trading_data import TradingDataService | ||
from tests.vega_query.fixtures import tds, parties | ||
|
||
from typing import List | ||
|
||
import vega_protos.protos as protos | ||
|
||
|
||
@pytest.mark.vega_query | ||
def test_get_volume_discount_stats(tds: TradingDataService): | ||
for stat in tds.get_volume_discount_stats(): | ||
assert isinstance( | ||
stat, protos.data_node.api.v2.trading_data.VolumeDiscountStats | ||
) | ||
|
||
|
||
@pytest.mark.vega_query | ||
def test_get_volume_discount_stats_at_epoch(tds: TradingDataService): | ||
at_epoch = 0 | ||
for stat in tds.get_volume_discount_stats(at_epoch=0): | ||
assert stat.at_epoch == at_epoch | ||
|
||
|
||
@pytest.mark.vega_query | ||
def test_get_volume_discount_stats_party_id( | ||
tds: TradingDataService, parties: List[str] | ||
): | ||
party_id = parties[0] | ||
for stat in tds.get_volume_discount_stats(party_id=party_id): | ||
assert stat.party_id == party_id |
29 changes: 29 additions & 0 deletions
29
tests/vega_query/service/service_trading_data/test_get_volume_rebate_program_stats.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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import pytest | ||
|
||
from vega_query.service.service_trading_data import TradingDataService | ||
from tests.vega_query.fixtures import tds, parties | ||
|
||
from typing import List | ||
|
||
import vega_protos.protos as protos | ||
|
||
|
||
@pytest.mark.vega_query | ||
def test_get_volume_rebate_stats(tds: TradingDataService): | ||
for stat in tds.get_volume_rebate_stats(): | ||
assert isinstance(stat, protos.data_node.api.v2.trading_data.VolumeRebateStats) | ||
|
||
|
||
@pytest.mark.vega_query | ||
def test_get_volume_rebate_stats_at_epoch(tds: TradingDataService): | ||
at_epoch = 0 | ||
for stat in tds.get_volume_rebate_stats(at_epoch=0): | ||
assert stat.at_epoch == at_epoch | ||
|
||
|
||
@pytest.mark.vega_query | ||
def test_get_volume_rebate_stats_party_id(tds: TradingDataService, parties: List[str]): | ||
party_id = parties[0] | ||
stats = tds.get_volume_rebate_stats(party_id=party_id) | ||
for stat in stats: | ||
assert stat.party_id == party_id |
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.