def test_yahoo_keystats_fail500(self, mockget):
        mockget.return_value = ResponseStatus500()
        screen = StockScreen(100)
        test = False
        try:
            screen.yahooKeyStats('aa')

        except HTTPError:
            test = True

        self.assertEqual(test, True)
Esempio n. 2
0
    def test_yahoo_keystats_fail500(self, mockget):
        mockget.return_value = ResponseStatus500()
        screen = StockScreen(100)
        test = False
        try:
            screen.yahooKeyStats('aa')

        except HTTPError:
            test = True

        self.assertEqual(test, True)
Esempio n. 3
0
 def test_yahoo_keystats_success200(self, mockget):
     mockget.return_value = ResponseStatus200(self.yahoo_finance_html_path,
                                              'aci')
     screen = StockScreen(100)
     expected_screen_output = "price to book ratio: aci, 0.05\nPEG ration: aci -0.01\n"
     output = screen.yahooKeyStats('aci')
     self.assertEqual(expected_screen_output, output)
 def test_yahoo_keystats_success200(self, mockget):
     mockget.return_value = ResponseStatus200(self.yahoo_finance_html_path, 'aci')
     screen = StockScreen(100)
     expected_screen_output = "price to book ratio: aci, 0.05\nPEG ration: aci -0.01\n"
     output = screen.yahooKeyStats('aci')
     self.assertEqual(expected_screen_output, output)