Exemplo n.º 1
0
def test_every_second_matches() -> None:
    """12131415 produces 4."""
    assert rcaptcha.checksum_opposite(12131415) == 4
Exemplo n.º 2
0
def test_all_match_halfway_ahead() -> None:
    """123123 produces 12."""
    assert rcaptcha.checksum_opposite(123123) == 12
Exemplo n.º 3
0
def test_easy_not_matching_halfway_ahead() -> None:
    """1221 produces 0, because every comparison is between a 1 and a 2."""
    assert rcaptcha.checksum_opposite(1221) == 0
Exemplo n.º 4
0
def test_one_match_halfway_ahead() -> None:
    """123425 produces 4, because both 2s match each other, but no other digit
    has a match."""
    assert rcaptcha.checksum_opposite(123425) == 4
Exemplo n.º 5
0
def test_easy_halfway_ahead() -> None:
    """1212 produces 6: the list contains 4 items, and all four digits match
    the digit 2 items ahead."""
    assert rcaptcha.checksum_opposite(1212) == 6