Skip to content

packages.valory.skills.abstract_round_abci.tests.test_base_rounds

Test the base round classes.

TestCollectionRound Objects

class TestCollectionRound(_BaseRoundTestClass)

Test class for CollectionRound.

setup_method

def setup_method() -> None

Setup test.

test_serialized_collection

def test_serialized_collection() -> None

Test serialized_collection property.

test_run

def test_run() -> None

Run tests.

TestCollectDifferentUntilAllRound Objects

class TestCollectDifferentUntilAllRound(_BaseRoundTestClass)

Test class for CollectDifferentUntilAllRound.

test_run

def test_run() -> None

Run Tests.

TestCollectSameUntilAllRound Objects

class TestCollectSameUntilAllRound(_BaseRoundTestClass)

Test class for CollectSameUntilAllRound.

test_run

def test_run() -> None

Run Tests.

TestCollectSameUntilThresholdRound Objects

class TestCollectSameUntilThresholdRound(_BaseRoundTestClass)

Test CollectSameUntilThresholdRound.

test_run

@pytest.mark.parametrize(
    "selection_key",
    ("dummy_selection_key", tuple(f"dummy_selection_key_{i}"
                                  for i in range(2))),
)
def test_run(selection_key: Union[str, Tuple[str, ...]]) -> None

Run tests.

test_run_with_none

def test_run_with_none() -> None

Run tests.

TestOnlyKeeperSendsRound Objects

class TestOnlyKeeperSendsRound(_BaseRoundTestClass,
                               BaseOnlyKeeperSendsRoundTest)

Test OnlyKeeperSendsRound.

test_run

@pytest.mark.parametrize("payload_key",
                         ("dummy_key", tuple(f"dummy_key_{i}"
                                             for i in range(2))))
def test_run(payload_key: Union[str, Tuple[str, ...]]) -> None

Run tests.

test_keeper_payload_is_none

def test_keeper_payload_is_none() -> None

Test keeper payload valur set to none.

TestVotingRound Objects

class TestVotingRound(_BaseRoundTestClass)

Test VotingRound.

setup_test_voting_round

def setup_test_voting_round() -> DummyVotingRound

Setup test voting round

test_vote_count

def test_vote_count() -> None

Testing agent vote count

test_threshold

@pytest.mark.parametrize("vote", [True, False, None])
def test_threshold(vote: Optional[bool]) -> None

Runs threshold test.

test_end_round_no_majority

def test_end_round_no_majority() -> None

Test end round

test_invalid_vote_payload_count

def test_invalid_vote_payload_count() -> None

Testing agent vote count with invalid payload.

TestCollectDifferentUntilThresholdRound Objects

class TestCollectDifferentUntilThresholdRound(_BaseRoundTestClass)

Test CollectDifferentUntilThresholdRound.

test_run

@pytest.mark.parametrize("required_confirmations",
                         (MAX_PARTICIPANTS, MAX_PARTICIPANTS + 1))
def test_run(required_confirmations: int) -> None

Run tests.

test_end_round

def test_end_round() -> None

Test end round

TestCollectNonEmptyUntilThresholdRound Objects

class TestCollectNonEmptyUntilThresholdRound(_BaseRoundTestClass)

Test CollectNonEmptyUntilThresholdRound.

test_get_non_empty_values

def test_get_non_empty_values() -> None

Test _get_non_empty_values.

test_process_payload

def test_process_payload() -> None

Test process_payload.

test_end_block

@pytest.mark.parametrize(
    "selection_key",
    ("dummy_selection_key", tuple(f"dummy_selection_key_{i}"
                                  for i in range(2))),
)
@pytest.mark.parametrize(
    "is_value_none, expected_event",
    ((True, DummyEvent.NONE), (False, DummyEvent.DONE)),
)
def test_end_block(selection_key: Union[str, Tuple[str, ...]],
                   is_value_none: bool, expected_event: str) -> None

Test end_block when collection threshold is reached.