示例#1
0
 def test_repr_partial(self):
     self.assertEqual(
         "PriceEvent(Subject(AssetClass=Fx,Currency=EUR,Quantity=10000.00,Symbol=EURUSD),"
         " Price({'AskSize': '1000000.0', 'BidSize': '1000000.0', 'Ask': '1.109271', 'Bid': '1.107795'})"
         " Full(False))",
         repr(PriceEvent(SUBJECT, PRICE, False)),
     )
示例#2
0
 def test_string_partial(self):
     self.assertEqual(
         "PriceEvent AssetClass=Fx,Currency=EUR,Quantity=10000.00,Symbol=EURUSD is "
         "{'AskSize': '1000000.0', 'BidSize': '1000000.0', 'Ask': '1.109271', 'Bid': '1.107795'} Partial",
         str(PriceEvent(SUBJECT, PRICE, False)),
     )
示例#3
0
 def test_get_full(self):
     self.assertEqual(True, PriceEvent(SUBJECT, PRICE, True).full)
     self.assertEqual(False, PriceEvent(SUBJECT, PRICE, False).full)
示例#4
0
 def test_get_price_is_false_when_there_are_no_fields(self):
     self.assertEqual(False, True if PriceEvent(SUBJECT, {}, True).price else False)
示例#5
0
 def test_get_price_is_true_when_there_are_fields(self):
     self.assertEqual(
         True, True if PriceEvent(SUBJECT, PRICE, True).price else False
     )
示例#6
0
 def test_get_price(self):
     self.assertDictEqual(PRICE, PriceEvent(SUBJECT, PRICE, True).price)
示例#7
0
 def test_get_subject(self):
     self.assertEqual(SUBJECT, PriceEvent(SUBJECT, PRICE, True).subject)