Mercurial > hg > Lemuriformes
diff 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 diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/test_transpose.py Sun Dec 10 17:57:03 2017 -0800 @@ -0,0 +1,27 @@ +#!/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()