def runTest(self): ''' Run the tests. :param None :return: None ''' self.assertEqual( DailyDataServices.update_daily_data_by_symbol("AA")[0], True) self.assertEqual( DailyDataServices.update_daily_data_by_symbol("A2")[0], False) self.assertTrue( len(DailyDataServices.get_daily_data_by_symbol("AA")) > 0) self.assertTrue( len(DailyDataServices.get_daily_data_by_symbol("A2")) == 0) self.assertTrue(DailyDataServices.is_daily_data_by_symbol("AA")[0]) self.assertFalse(DailyDataServices.is_daily_data_by_symbol("A2")[0]) self.assertTrue(DailyDataServices.remove_daily_data_by_symbol("AA")[0]) self.assertTrue( len(DailyDataServices.get_daily_data_by_symbol("AA")) == 0) self.assertEqual( DailyDataServices.update_daily_data_by_symbol("AA")[0], True) self.assertTrue( len(DailyDataServices.get_daily_data_by_symbol("AA")) > 0)
def symbol_delete(): logger.info("symbol_delete()") try: symbol = request.args["symbol"] symbols_manager = SymbolsManager() result = symbols_manager.remove_symbol(symbol) if result[0]: result = DailyDataServices.remove_daily_data_by_symbol(symbol) else: logger.debug("symbol_delete()", result[1]) except Exception, e: logger.debug("symbol_delete()", exc_info=True) result = (False, "Unexpected Error")
def symbol_delete(): logger.info("symbol_delete()") try: symbol = request.args["symbol"] symbols_manager = SymbolsManager() result = symbols_manager.remove_symbol(symbol) if result[0]: result = DailyDataServices.remove_daily_data_by_symbol(symbol) else: logger.debug("symbol_delete()", result[1]) except Exception, e: logger.debug("symbol_delete()", exc_info=True) result = (False, "Unexpected Error")
def runTest(self): """ Run the tests. :param None :return: None """ self.assertEqual(DailyDataServices.update_daily_data_by_symbol("AA")[0], True) self.assertEqual(DailyDataServices.update_daily_data_by_symbol("A2")[0], False) self.assertTrue(len(DailyDataServices.get_daily_data_by_symbol("AA")) > 0) self.assertTrue(len(DailyDataServices.get_daily_data_by_symbol("A2")) == 0) self.assertTrue(DailyDataServices.is_daily_data_by_symbol("AA")[0]) self.assertFalse(DailyDataServices.is_daily_data_by_symbol("A2")[0]) self.assertTrue(DailyDataServices.remove_daily_data_by_symbol("AA")[0]) self.assertTrue(len(DailyDataServices.get_daily_data_by_symbol("AA")) == 0) self.assertEqual(DailyDataServices.update_daily_data_by_symbol("AA")[0], True) self.assertTrue(len(DailyDataServices.get_daily_data_by_symbol("AA")) > 0)