Exemplo n.º 1
0
 def test_contains(self):
     """Test use of 'in' and 'not in' operators"""
     msg = FixMessage()
     msg.append_strings(["8=FIX.4.4", "35=0"])
     self.assertIn(8, msg)
     self.assertIn(35, msg)
     self.assertNotIn(9, msg)
     self.assertNotIn(10, msg)
     return
Exemplo n.º 2
0
 def test_strings(self):
     """Test adding fields from a sequence of tag=value strings"""
     msg = FixMessage()
     msg.append_strings(["8=FIX.4.4", "35=0"])
     self.assertEqual(fix_str("8=FIX.4.4\x01"
                              "9=5\x01"
                              "35=0\x01"
                              "10=163\x01"),
                      msg.encode())