def test_large_spirals(): result = generate_spiral(25, 'up') assert np.max(result) == 25*25 - 1 assert result.dtype == np.uint16
def test_3d_spiral_fails(): with pytest.raises(ValueError): generate_spiral((4, 4, 4), 'up', clockwise=False)
def test_incorrect_dir(): with pytest.raises(ValueError): generate_spiral((4, 4), 'any random direction', clockwise=True)
def test_rectangle(): with pytest.raises(ValueError): generate_spiral((3, 5), 'down', clockwise=False)
def test_negative_shape(): with pytest.raises(ValueError): generate_spiral((-4, 3), 'up', clockwise=True)
def test_generate_spiral(kwargs, expected): np.testing.assert_array_equal(generate_spiral(**kwargs), expected)