def test_get_stock_scores4(self): # below price book limit. metrics = StockMetrics(10, 15, 12.5, 2.5, stock_evaluator.PRICE_BOOK_LIMIT - 1, 2.1, 5.4, 3.4, 0.2) self.assertEquals(stock_evaluator.evaluate_stock(metrics), 17.125)
def test_get_stock_scores9(self): # high EPS prediction. metrics = StockMetrics(10, 15, 12.5, 2.5, 3.3, 2.1, 5.4, 3.4, 100) self.assertEquals(stock_evaluator.evaluate_stock(metrics), 13.125)
def test_get_stock_scores7(self): # price-earnings ratio is 0, low score. metrics = StockMetrics(10, 15, 12.5, 0, 3.3, 2.1, 5.4, 3, 0.2) self.assertEquals(stock_evaluator.evaluate_stock(metrics), -10000.375)
def test_get_stock_scores6(self): # price-earnings to growth ratio is 0, almost low score. metrics = StockMetrics(10, 15, 12.5, 2.5, 3.3, 2.1, 5.4, 0, 0.2) self.assertEquals(stock_evaluator.evaluate_stock(metrics), 7.125)
def test_get_stock_scores5(self): # price-sales is 0. metrics = StockMetrics(10, 15, 12.5, 2.5, 3, 0, 5, 3, 0.2) self.assertEquals(stock_evaluator.evaluate_stock(metrics), 6.625)
def test_get_stock_scores2(self): # 0 price, low score. metrics = StockMetrics(0, 15, 12.5, 2.5, 3.3, 2.1, 5.4, 3.4, 0.2) self.assertEquals(stock_evaluator.evaluate_stock(metrics), stock_evaluator.LOW_SCORE)
def test_get_stock_scores(self): # Normal numbers. metrics = StockMetrics(10, 15, 12.5, 2.5, 3.3, 2.1, 5.4, 3.4, 0.2) self.assertEquals(stock_evaluator.evaluate_stock(metrics), 12.125)