diff options
Diffstat (limited to 'scripts/test_thread_instr.py')
| -rw-r--r-- | scripts/test_thread_instr.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/scripts/test_thread_instr.py b/scripts/test_thread_instr.py new file mode 100644 index 0000000..d23e440 --- /dev/null +++ b/scripts/test_thread_instr.py @@ -0,0 +1,21 @@ +import sys +import unittest +from pathlib import Path + +sys.path.insert(0, str(Path(__file__).resolve().parent)) +import thread_instr as ti + + +class ThreadInstrTests(unittest.TestCase): + def test_sums_threads_by_name(self): + text = "\n".join([ + "Game.Desk-100,5000,,instructions:u,100,100.00,,", + "audio-101,300,,instructions:u,100,100.00,,", + "audio-102,200,,instructions:u,100,100.00,,", + "gl0-103,<not counted>,,instructions:u,0,0.00,,", + ]) + self.assertEqual(ti.parse(text), {"Game.Desk": 5000, "audio": 500}) + + +if __name__ == "__main__": + unittest.main() |
