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')