From 7b37953903f7161da815d9c115093b0bae442246 Mon Sep 17 00:00:00 2001 From: Richard Feistenauer Date: Thu, 31 Jan 2019 15:56:17 +0100 Subject: [PATCH] added coverage files to ignore --- .gitignore | 4 +++- test/test_state.py | 20 ++++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 test/test_state.py diff --git a/.gitignore b/.gitignore index 7e4df26..9bb6c19 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ .idea/ *.pyc__pycache__ -__pycache__ \ No newline at end of file +__pycache__ +.coverage +htmlcov/ \ No newline at end of file diff --git a/test/test_state.py b/test/test_state.py new file mode 100644 index 0000000..fababeb --- /dev/null +++ b/test/test_state.py @@ -0,0 +1,20 @@ +import sys +sys.path.append('../src') + +import cellular_automaton.ca_cell_state as cs +import unittest + + +class TestState(unittest.TestCase): + + def test_state_slots(self): + cell_state = cs.CellState([0]) + cell_state.set_status_of_iteration([1], 0) + cell_state.set_status_of_iteration([2], 1) + cell_state.set_status_of_iteration([3], 2) + + self.assertEqual(cell_state.get_status_of_iteration(0), [3]) + + +if __name__ == '__main__': + unittest.main()