diff options
Diffstat (limited to 'tests/test_solter.py')
-rw-r--r-- | tests/test_solter.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/test_solter.py b/tests/test_solter.py new file mode 100644 index 0000000..5166a4f --- /dev/null +++ b/tests/test_solter.py @@ -0,0 +1,15 @@ +import unittest +import solter + + +class TestSolter(unittest.TestCase): + def test_get_commands_send_data(self): + expected = ['call (int)send(3, "Hello World", 11, 0x4000)'] + + self.assertEqual(solter.get_commands_send_data(sockfd=3, data="Hello World"), expected) + + with self.assertRaises(ValueError): + solter.get_commands_send_data(sockfd=3, data='Hello"World') + + with self.assertRaises(ValueError): + solter.get_commands_send_data(sockfd=3, data='Hello\nWorld') |