コード例 #1
0
ファイル: test_autocrop.py プロジェクト: yintianjun/autocrop
def test_size_minus_14_not_valid():
    with pytest.raises(Exception) as e:
        size(-14)
    assert 'Invalid pixel' in str(e)
コード例 #2
0
ファイル: test_autocrop.py プロジェクト: yintianjun/autocrop
def test_size_asdf_gives_ValueError():
    with pytest.raises(Exception) as e:
        size('asdf')
    assert 'ValueError' in str(e)
コード例 #3
0
ファイル: test_autocrop.py プロジェクト: yintianjun/autocrop
def test_size_million_not_valid():
    with pytest.raises(Exception) as e:
        size(1e6)
    assert 'Invalid pixel' in str(e)
コード例 #4
0
ファイル: test_autocrop.py プロジェクト: yintianjun/autocrop
def test_size_140_is_valid():
    assert size(140) == 140
コード例 #5
0
def test_size_asdf_gives_ValueError():
    with pytest.raises(Exception) as e:
        size("asdf")
    assert "ValueError" in str(e)
コード例 #6
0
def test_size_0_not_valid():
    with pytest.raises(Exception) as e:
        size(0)
    assert "Invalid pixel" in str(e)