Esempio n. 1
0
def test_get_excuse_image__who_missing__why_missing__what_too_long():
    ERROR_CODE_WHO_MISSING = 1010
    ERROR_CODE_WHY_MISSING = 1020
    ERROR_CODE_WHAT_TOO_LONG = 1031
    data = get_excuse_image('', '', 'compilingcompilingcompiling')
    assert set([error['code'] for error in data]) == \
        set([ERROR_CODE_WHO_MISSING, ERROR_CODE_WHY_MISSING, ERROR_CODE_WHAT_TOO_LONG])
Esempio n. 2
0
def test_get_excuse_image__why_missing():
    ERROR_CODE = 1020
    data = get_excuse_image('a', '', 'a')
    assert data[0]['code'] == ERROR_CODE
Esempio n. 3
0
def test_get_excuse_image__success():
    data = get_excuse_image('programmer', 'my code is compiling', 'compiling')
    assert isinstance(data, Image.Image)
    assert data.size == (413, 360)
Esempio n. 4
0
def test_get_excuse_image__who_too_long__why_missing():
    ERROR_CODE_WHO_TOO_LONG = 1011
    ERROR_CODE_WHY_MISSING = 1020
    data = get_excuse_image('programmerprogrammerprogrammer', '', 'a')
    assert set([error['code'] for error in data]) == \
        set([ERROR_CODE_WHO_TOO_LONG, ERROR_CODE_WHY_MISSING])
Esempio n. 5
0
def test_get_excuse_image__what_too_long():
    ERROR_CODE = 1031
    data = get_excuse_image('a', 'a', 'compilingcompilingcompiling')
    assert data[0]['code'] == ERROR_CODE
Esempio n. 6
0
def test_get_excuse_image__why_too_long():
    ERROR_CODE = 1021
    data = get_excuse_image(
        'a', 'my code is compiling my code is compiling my code is compiling',
        'a')
    assert data[0]['code'] == ERROR_CODE
Esempio n. 7
0
def test_get_excuse_image__who_too_long():
    ERROR_CODE = 1011
    data = get_excuse_image('programmerprogrammerprogrammer', 'a', 'a')
    assert data[0]['code'] == ERROR_CODE