コード例 #1
0
ファイル: test_util.py プロジェクト: snowind/microscopium
def test_large_spirals():
    result = generate_spiral(25, 'up')
    assert np.max(result) == 25*25 - 1
    assert result.dtype == np.uint16
コード例 #2
0
ファイル: test_util.py プロジェクト: snowind/microscopium
def test_3d_spiral_fails():
    with pytest.raises(ValueError):
        generate_spiral((4, 4, 4), 'up', clockwise=False)
コード例 #3
0
ファイル: test_util.py プロジェクト: snowind/microscopium
def test_incorrect_dir():
    with pytest.raises(ValueError):
        generate_spiral((4, 4), 'any random direction', clockwise=True)
コード例 #4
0
ファイル: test_util.py プロジェクト: snowind/microscopium
def test_rectangle():
    with pytest.raises(ValueError):
        generate_spiral((3, 5), 'down', clockwise=False)
コード例 #5
0
ファイル: test_util.py プロジェクト: snowind/microscopium
def test_negative_shape():
    with pytest.raises(ValueError):
        generate_spiral((-4, 3), 'up', clockwise=True)
コード例 #6
0
ファイル: test_util.py プロジェクト: snowind/microscopium
def test_generate_spiral(kwargs, expected):
    np.testing.assert_array_equal(generate_spiral(**kwargs), expected)