def test_remove_stock_by_symbol(self): stock_exchange = StockExchange('test') stock = Stock('GIN', 'preferred', '8', '100', '2%') stock_exchange.add_new_stock(stock) stock_exchange.remove_existing_stock_by_symbol('GIN') stock_exchange.remove_existing_stock_by_symbol('TEA')
def test_type_mismatch(self): stock = Stock('GIN', 'preferred', '8', '100') self.assertEqual(stock.stock_type, 'preferred') self.assertIsNone(stock.fixed_dividend) self.assertFalse(stock.created_successfully)
def test_add_new_stock(self): stock_exchange = StockExchange('test') stock = Stock('GIN', 'preferred', '8', '100', '2%') stock_exchange.add_new_stock(stock) stock_exchange.add_new_stock(stock)
def test_exceptions1(self): stock = Stock('GIN', 'other', 'test', 'test1', 'test3', 'stock_exchange') self.assertFalse(stock.created_successfully)