def test__remove_useless_orders(self): allocation = {'goog': 34, 'aapl': -134, 'useless': 0, 'also': -0} new_allocation = portfolio._remove_useless_orders(allocation) allocation.pop('useless') allocation.pop('also') eq_(new_allocation, allocation)
def test__remove_useless_orders_nothing_to_do(self): allocation = {'goog': 34, 'aapl': -134} new_allocation = portfolio._remove_useless_orders(allocation) eq_(new_allocation, allocation)
def test__remove_useless_orders_empty_orders(self): allocation = {} new_allocation = portfolio._remove_useless_orders(allocation) eq_(new_allocation, {})