Commit eb82c251 authored by Jeremy Pallats's avatar Jeremy Pallats 💬
Browse files

FIX: Negative votes are valid to correct errors.

parent 3d82a490
Loading
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -816,8 +816,6 @@ def parse_vote_tuple(vote_tuple):

        vote_type = EVoteType.cons if vote_type == 'cons' else EVoteType.prep
        amount = int(amount)
        if amount < 1:
            raise ValueError("Vote amount must be greater than 0.")
    except ValueError as exc:
        raise ThrowArggumentParser from exc

+0 −3
Original line number Diff line number Diff line
@@ -54,8 +54,5 @@ def test_parse_vote_tuple():
    with pytest.raises(cog.parse.ThrowArggumentParser):
        cog.parse.parse_vote_tuple(['cons', 'wrong'])

    with pytest.raises(cog.parse.ThrowArggumentParser):
        cog.parse.parse_vote_tuple(['cons', '-5'])

    assert cog.parse.parse_vote_tuple(['cons', '5']) == (EVoteType.cons, 5)
    assert cog.parse.parse_vote_tuple(['1', 'prep']) == (EVoteType.prep, 1)