Commit 3e3dc003 authored by Christian Wander's avatar Christian Wander
Browse files

add unit tests

parent 9e5f0056
import unittest
import blink
class TestBlink(unittest.TestCase):
def test_tuplify(self):
data = [[(1, 2, 3), (1, 2, 3)],
[(1, 2, 3), (1, 2, 3)]]
expected = (1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3)
actual = blink.Thing.tuplify(data)
self.assertEqual(expected, actual)
def test_snakify(self):
data = [[(1, 2, 3), (1, 2, 3)],
[(1, 1, 1), (3, 3, 3)]]
expected = [[(1, 2, 3), (1, 2, 3)],
[(3, 3, 3), (1, 1, 1)]] # <-- order in 2nd line switched!
t = blink.Thing(data)
self.assertEqual(t.snakify(), expected)
if __name__ == "__main__":
unittest.main()
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment