mirror of
https://github.com/adulau/nato-converter.git
synced 2024-11-22 01:57:08 +00:00
28 lines
930 B
Python
Executable file
28 lines
930 B
Python
Executable file
#!/usr/bin/env python
|
|
# -*- coding: utf-8 -*-
|
|
|
|
import nato_converter
|
|
import unittest
|
|
|
|
class TestFindInTable(unittest.TestCase):
|
|
def test_find_lower(self):
|
|
self.assertEqual("alpha", nato_converter.find_in_table("a"))
|
|
|
|
def test_find_upper(self):
|
|
self.assertEqual("ALPHA", nato_converter.find_in_table("A"))
|
|
|
|
def test_find_space(self):
|
|
self.assertEqual("", nato_converter.find_in_table(" "))
|
|
self.assertEqual("", nato_converter.find_in_table("\t"))
|
|
self.assertEqual("", nato_converter.find_in_table("\n"))
|
|
|
|
def test_find_multiple(self):
|
|
self.assertRaises(nato_converter.IllegalStringSize,
|
|
nato_converter.find_in_table, "aa")
|
|
|
|
def test_find_special_char(self):
|
|
self.assertEqual("1", nato_converter.find_in_table("1"))
|
|
self.assertEqual(u"é", nato_converter.find_in_table(u"é"))
|
|
|
|
if __name__ == '__main__':
|
|
unittest.main()
|