Skip to content

packages.valory.skills.abstract_round_abci.tests.test_tools.test_rounds

Test the rounds test tool module of the skill.

test_get_participants

def test_get_participants() -> None

Test get_participants.

DummyTxPayloadMatcher Objects

class DummyTxPayloadMatcher()

A DummyTxPayload matcher for assertion comparisons.

__init__

def __init__(expected: DummyTxPayload) -> None

Initialize the matcher.

__repr__

def __repr__() -> str

Needs to be implemented for better assertion messages.

__eq__

def __eq__(other: Any) -> bool

The method that will be used for the assertion comparisons.

test_get_dummy_tx_payloads

@given(
    st.frozensets(st.text(max_size=200), max_size=100),
    st.text(max_size=500),
    st.one_of(st.none(), st.booleans()),
    st.booleans(),
)
def test_get_dummy_tx_payloads(participants: FrozenSet[str], value: str,
                               vote: Optional[bool],
                               is_value_none: bool) -> None

Test get_dummy_tx_payloads.

TestDummyTxPayload Objects

class TestDummyTxPayload()

Test class for DummyTxPayload

test_properties

@staticmethod
@given(st.text(max_size=200), st.text(max_size=500), st.booleans())
def test_properties(sender: str, value: str, vote: bool) -> None

Test all the properties.

TestDummySynchronizedData Objects

class TestDummySynchronizedData()

Test class for DummySynchronizedData.

test_most_voted_keeper_address

@staticmethod
@given(st.lists(st.text(max_size=200), max_size=100))
def test_most_voted_keeper_address(
        most_voted_keeper_address_data: List[str]) -> None

Test most_voted_keeper_address.

TestBaseRoundTestClass Objects

class TestBaseRoundTestClass()

Test BaseRoundTestClass.

test_test_no_majority_event

@staticmethod
def test_test_no_majority_event() -> None

Test _test_no_majority_event.

test_complete_run

@staticmethod
@given(st.integers(min_value=0, max_value=100), st.integers(min_value=1))
def test_complete_run(iter_count: int, shift: int) -> None

Test _complete_run.

BaseTestBase Objects

class BaseTestBase()

Base class for the Base tests.

setup_method

def setup_method() -> None

Setup that is run before each test.

create_test_gen

def create_test_gen(**kwargs: Any) -> None

Create the base test generator.

exhaust_base_test_gen

def exhaust_base_test_gen() -> None

Exhaust the base test generator.

run_test

def run_test(**kwargs: Any) -> None

Run a test for a base test.

DummyCollectDifferentUntilAllRoundWithEndBlock Objects

class DummyCollectDifferentUntilAllRoundWithEndBlock(
        DummyCollectDifferentUntilAllRound)

A DummyCollectDifferentUntilAllRound with end_block implemented.

__init__

def __init__(dummy_exit_event: DummyEvent, *args: Any, **kwargs: Any)

Initialize the dummy class.

end_block

def end_block() -> Optional[Tuple[BaseSynchronizedData, Enum]]

A dummy end_block implementation.

TestBaseCollectDifferentUntilAllRoundTest Objects

class TestBaseCollectDifferentUntilAllRoundTest(BaseTestBase)

Test BaseCollectDifferentUntilAllRoundTest.

test_test_round

@given(st.one_of(st.none(), st.sampled_from(DummyEvent)), )
def test_test_round(exit_event: DummyEvent) -> None

Test _test_round.

DummyCollectSameUntilAllRoundWithEndBlock Objects

class DummyCollectSameUntilAllRoundWithEndBlock(DummyCollectSameUntilAllRound)

A DummyCollectSameUntilAllRound with end_block implemented.

__init__

def __init__(dummy_exit_event: DummyEvent, *args: Any, **kwargs: Any)

Initialize the dummy class.

end_block

def end_block() -> Optional[Tuple[BaseSynchronizedData, Enum]]

A dummy end_block implementation.

TestBaseCollectSameUntilAllRoundTest Objects

class TestBaseCollectSameUntilAllRoundTest(BaseTestBase)

Test BaseCollectSameUntilAllRoundTest.

test_test_round

@given(
    st.sampled_from(DummyEvent),
    st.text(max_size=500),
    st.booleans(),
)
def test_test_round(exit_event: DummyEvent, common_value: str,
                    finished: bool) -> None

Test _test_round.

DummyCollectSameUntilThresholdRoundWithEndBlock Objects

class DummyCollectSameUntilThresholdRoundWithEndBlock(
        DummyCollectSameUntilThresholdRound)

A DummyCollectSameUntilThresholdRound with end_block overriden.

__init__

def __init__(dummy_exit_event: DummyEvent, *args: Any, **kwargs: Any)

Initialize the dummy class.

end_block

def end_block() -> Optional[Tuple[BaseSynchronizedData, Enum]]

A dummy end_block override.

TestBaseCollectSameUntilThresholdRoundTest Objects

class TestBaseCollectSameUntilThresholdRoundTest(BaseTestBase)

Test BaseCollectSameUntilThresholdRoundTest.

test_test_round

@given(
    st.sampled_from(DummyEvent),
    st.text(max_size=500),
)
def test_test_round(exit_event: DummyEvent, most_voted_payload: str) -> None

Test _test_round.

DummyOnlyKeeperSendsRoundTest Objects

class DummyOnlyKeeperSendsRoundTest(DummyOnlyKeeperSendsRound)

A DummyOnlyKeeperSendsRound with end_block implemented.

__init__

def __init__(dummy_exit_event: DummyEvent, *args: Any, **kwargs: Any)

Initialize the dummy class.

end_block

def end_block() -> Optional[Tuple[BaseSynchronizedData, Enum]]

A dummy end_block implementation.

TestBaseOnlyKeeperSendsRoundTest Objects

class TestBaseOnlyKeeperSendsRoundTest(BaseTestBase)

Test BaseOnlyKeeperSendsRoundTest.

setup_method

def setup_method() -> None

Setup that is run before each test.

test_test_round

@given(
    st.sampled_from(DummyEvent),
    st.text(),
)
def test_test_round(exit_event: DummyEvent, keeper_value: str) -> None

Test _test_round.

DummyBaseVotingRoundTestWithEndBlock Objects

class DummyBaseVotingRoundTestWithEndBlock(DummyVotingRound)

A DummyVotingRound with end_block overriden.

end_block

def end_block() -> Optional[Tuple[BaseSynchronizedData, Enum]]

A dummy end_block override.

TestBaseVotingRoundTest Objects

class TestBaseVotingRoundTest(BaseTestBase)

Test BaseVotingRoundTest.

test_test_round

@given(st.one_of(st.none(), st.booleans()), )
def test_test_round(is_keeper_set: Optional[bool]) -> None

Test _test_round.

DummyCollectDifferentUntilThresholdRoundWithEndBlock Objects

class DummyCollectDifferentUntilThresholdRoundWithEndBlock(
        DummyCollectDifferentUntilThresholdRound)

A DummyCollectDifferentUntilThresholdRound with end_block implemented.

__init__

def __init__(dummy_exit_event: DummyEvent, *args: Any, **kwargs: Any)

Initialize the dummy class.

end_block

def end_block() -> Optional[Tuple[BaseSynchronizedData, Enum]]

A dummy end_block implementation.

TestBaseCollectDifferentUntilThresholdRoundTest Objects

class TestBaseCollectDifferentUntilThresholdRoundTest(BaseTestBase)

Test BaseCollectDifferentUntilThresholdRoundTest.

test_test_round

@given(st.sampled_from(DummyEvent))
def test_test_round(exit_event: DummyEvent) -> None

Test _test_round.