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)
Ejemplo n.º 2
0
def daily_curve():
    logger.info("daily_curve()")
    symbol = request.args["symbol"]
    daily_curve = []
    try:
        if DailyDataServices.is_daily_data_by_symbol(symbol):
            daily_curve = DailyDataServices.get_daily_data_by_symbol(symbol)
    except Exception, e:
        logger.debug("daily_curve()", exc_info=True)
        daily_curve = []
Ejemplo n.º 3
0
def daily_curve():
    logger.info("daily_curve()")
    symbol = request.args["symbol"]
    daily_curve = []
    try:
        if DailyDataServices.is_daily_data_by_symbol(symbol):
            daily_curve = DailyDataServices.get_daily_data_by_symbol(symbol)
    except Exception, e:
        logger.debug("daily_curve()", exc_info=True)
        daily_curve = []
    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)