def data_point_for_article(article, price_epsilon): article_start_time = article.effective_date currency_pair = article.currency_pair article_epsilon = dt.timedelta(hours=1) data_point = anal.data_point(currency_pair, article_start_time + article_epsilon, article_epsilon, price_epsilon) return data_point
def setUp(self): TestLR.setUp(self) self.currency_pair = root[("GBP", "USD")] self.article_start_time = dt.datetime(2011, 9, 9, 11) self.article_epsilon = dt.timedelta(hours=5) self.named_entities = anal.named_entities_in_time_range(self.currency_pair, self.article_start_time, self.article_epsilon) self.currency_price_at_time = self.article_start_time + self.article_epsilon + dt.timedelta(minutes=5) self.currency_price = anal.currency_price_at_time(self.currency_pair, self.currency_price_at_time) self.data_point = anal.data_point(self.currency_pair, self.article_start_time + self.article_epsilon, self.article_epsilon, dt.timedelta(minutes=5))
def setUp(self): TestLR.setUp(self) self.currency_pair = root[("GBP", "USD")] self.article_start_time = dt.datetime(2011, 9, 9, 11) self.article_epsilon = dt.timedelta(hours=5) self.named_entities = anal.named_entities_in_time_range( self.currency_pair, self.article_start_time, self.article_epsilon) self.currency_price_at_time = self.article_start_time + self.article_epsilon + dt.timedelta( minutes=5) self.currency_price = anal.currency_price_at_time( self.currency_pair, self.currency_price_at_time) self.data_point = anal.data_point( self.currency_pair, self.article_start_time + self.article_epsilon, self.article_epsilon, dt.timedelta(minutes=5))
def test_analengine_has_no_articles(self): self.assertRaisesRegexp(KeyError, "No named entities found in article.", lambda: anal.data_point(self.currency_pair, dt.datetime(2011, 9, 11, 20), dt.timedelta(hours=2), dt.timedelta(minutes=5)))
def test_analengine_has_no_articles(self): self.assertRaisesRegexp( KeyError, "No named entities found in article.", lambda: anal.data_point( self.currency_pair, dt.datetime(2011, 9, 11, 20), dt.timedelta(hours=2), dt.timedelta(minutes=5)))