コード例 #1
0
ファイル: test_stocks.py プロジェクト: noisyoscillator/pyEX
    def test_dividends(self):
        from pyEX import dividends
        from pyEX.common import PyEXception
        with patch('requests.get') as mock:
            mock.return_value = MagicMock()
            mock.return_value.status_code = 200
            dividends('test')

            try:
                dividends('test', 'test')
                assert False
            except PyEXception:
                pass
コード例 #2
0
 def test_dividends(self):
     from pyEX import dividends
     with patch('requests.get') as mock:
         mock.return_value = MagicMock()
         mock.return_value.status_code = 200
         dividends('test')