view 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
line wrap: on
line source

#!/usr/bin/env python

"""
test array transposition
"""

import os
import unittest
from lemuriformes.transpose import transpose

class TestTranspose(unittest.TestCase):

    def test_basic(self):
        """transpose a basic array"""

        array = [[1,2,3],
                 [4,5,6],
                 [7,8,9]]
        expected = [[1,4,7],
                    [2,5,8],
                    [3,6,9]]
        transposition = transpose(array)
        assert transposition == expected


if __name__ == '__main__':
    unittest.main()