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)), )
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)), )
def test_get_full(self): self.assertEqual(True, PriceEvent(SUBJECT, PRICE, True).full) self.assertEqual(False, PriceEvent(SUBJECT, PRICE, False).full)
def test_get_price_is_false_when_there_are_no_fields(self): self.assertEqual(False, True if PriceEvent(SUBJECT, {}, True).price else False)
def test_get_price_is_true_when_there_are_fields(self): self.assertEqual( True, True if PriceEvent(SUBJECT, PRICE, True).price else False )
def test_get_price(self): self.assertDictEqual(PRICE, PriceEvent(SUBJECT, PRICE, True).price)
def test_get_subject(self): self.assertEqual(SUBJECT, PriceEvent(SUBJECT, PRICE, True).subject)