def test_get_popularity(self): popularity = r.get_popularity(self.single_stock) self.assertEqual(popularity['instrument'], self.instrument) self.assertIn('instrument', popularity) self.assertIn('num_open_positions', popularity) fake_popularity = r.get_popularity(self.fake_stock) self.assertEqual(fake_popularity, '')
def test_get_popularity(self): popularity = r.get_popularity(self.single_stock) assert (popularity['instrument'] == self.instrument) assert ('instrument' in popularity) assert ('num_open_positions' in popularity) fake_popularity = r.get_popularity(self.fake_stock) assert (fake_popularity == '')
def test_events(self): event = r.get_events(self.single_stock) self.assertEqual(len(event), 0) event = r.get_events(self.event_stock) self.assertEqual(len(event), 1) event = event[0] self.assertIn('account', event) self.assertIn('cash_component', event) self.assertIn('chain_id', event) self.assertIn('created_at', event) self.assertIn('direction', event) self.assertIn('equity_components', event) self.assertIn('event_date', event) self.assertIn('id', event) self.assertIn('option', event) self.assertIn('position', event) self.assertIn('quantity', event) self.assertIn('state', event) self.assertIn('total_cash_amount', event) self.assertIn('type', event) self.assertIn('underlying_price', event) self.assertIn('updated_at', event) fake_event = r.get_popularity(self.fake_stock) self.assertEqual(fake_event, '')
def test_events(self): event = r.get_events(self.single_stock) assert (len(event) == 0) event = r.get_events(self.event_stock) assert (len(event) == 1) event = event[0] assert ('account' in event) assert ('cash_component' in event) assert ('chain_id' in event) assert ('created_at' in event) assert ('direction' in event) assert ('equity_components' in event) assert ('event_date' in event) assert ('id' in event) assert ('option' in event) assert ('position' in event) assert ('quantity' in event) assert ('state' in event) assert ('total_cash_amount' in event) assert ('type' in event) assert ('underlying_price' in event) assert ('updated_at' in event) fake_event = r.get_popularity(self.fake_stock) assert (fake_event == '')