comparison tests/test_transpose.py @ 18:56596902e9ae default tip

add some setup + tests
author Jeff Hammel <k0scist@gmail.com>
date Sun, 10 Dec 2017 17:57:03 -0800
parents
children
comparison
equal deleted inserted replaced
17:4793f99b73e0 18:56596902e9ae
1 #!/usr/bin/env python
2
3 """
4 test array transposition
5 """
6
7 import os
8 import unittest
9 from lemuriformes.transpose import transpose
10
11 class TestTranspose(unittest.TestCase):
12
13 def test_basic(self):
14 """transpose a basic array"""
15
16 array = [[1,2,3],
17 [4,5,6],
18 [7,8,9]]
19 expected = [[1,4,7],
20 [2,5,8],
21 [3,6,9]]
22 transposition = transpose(array)
23 assert transposition == expected
24
25
26 if __name__ == '__main__':
27 unittest.main()