def setUp(self): self.component_map = { "Level": "1", "Exchange": "LSE", "AssetClass": "Equity", "Symbol": "BARC", } self.subject = Subject.from_dict(self.component_map)
def test_dict_conversion_with_sorting(self): subject = Subject.from_dict( { "Currency": "EUR", "Quantity": "10000.00", "AssetClass": "Fx", "Symbol": "EURUSD", } ) self.assertEqual( str(subject), "AssetClass=Fx,Currency=EUR,Quantity=10000.00,Symbol=EURUSD" )
def test_subject_matches_its_clone(self): subject2 = Subject.from_dict(self.component_map) self.assertTrue(self.subject == subject2)