12 lines
319 B
Python
12 lines
319 B
Python
import math, pytest
|
|
from matrixmania import transpose
|
|
|
|
def test_transpose_basic():
|
|
matrix = [[1, 2, 3], [4, 5, 6]]
|
|
expected = [[1, 4], [2, 5], [3, 6]]
|
|
assert transpose(matrix) == expected
|
|
|
|
def test_transpose_invalid():
|
|
matrix = [[1, 2], [3]]
|
|
with pytest.raises(ValueError):
|
|
transpose(matrix) |