Пример #1
0
    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)
Пример #2
0
    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)
Пример #3
0
    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)
Пример #4
0
    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)
Пример #5
0
    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)
Пример #6
0
    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)
Пример #7
0
    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)