Example #1
0
def test_validate_input_non_numeric_value(monkeypatch, caplog):
    monkeypatch.setattr("builtins.input", lambda x: 'asdfa')
    assert album.validate_input() == -1
    assert caplog.record_tuples == [("root", logging.WARNING,
                                    INPUT_WARNING_MESSAGE)]
Example #2
0
def test_validate_input_greater_than_one_hundred(monkeypatch, caplog):
    monkeypatch.setattr("builtins.input", lambda x: '101')
    assert album.validate_input() == -1
    assert caplog.record_tuples == [("root", logging.WARNING,
                                    INPUT_WARNING_MESSAGE)]
Example #3
0
def test_validate_input_equal_to_one_hundred(monkeypatch):
    monkeypatch.setattr("builtins.input", lambda x: '100')
    assert album.validate_input() == 100
Example #4
0
def test_validate_input_less_than_one_hundred(monkeypatch):
    monkeypatch.setattr("builtins.input", lambda x: '99')
    assert album.validate_input() == 99
Example #5
0
def test_validate_input_between_one_and_one_hundred(monkeypatch):
    monkeypatch.setattr("builtins.input", lambda x: '46')
    assert album.validate_input() == 46
Example #6
0
def test_validate_input_greater_than_one(monkeypatch):
    monkeypatch.setattr("builtins.input", lambda x: '2')
    assert album.validate_input() == 2