Exemplo n.º 1
0
 def test_daily(self):
     from datetime import datetime
     from pyEX.stats import daily
     daily()
     daily('201505')
     daily(last='5')
     daily(datetime.today())
Exemplo n.º 2
0
 def test_daily(self):
     from pyEX.common import PyEXception
     from datetime import datetime
     from pyEX.stats import daily
     with patch('requests.get') as mock:
         mock.return_value = MagicMock()
         mock.return_value.status_code = 200
         daily()
         daily('201505')
         daily(last='5')
         daily(datetime.today())
         try:
             daily(5)
             assert False
         except PyEXception:
             pass
Exemplo n.º 3
0
    def test_daily(self):
        from pyEX.common import PyEXception
        from datetime import datetime
        from pyEX.stats import daily

        with patch("requests.get") as mock, patch("pickle.dump"):
            mock.return_value = MagicMock()
            mock.return_value.status_code = 200
            daily()
            daily("201505")
            daily(last="5")
            daily(datetime.today())
            try:
                daily(5)
                assert False
            except PyEXception:
                pass
Exemplo n.º 4
0
 def test_daily(self):
     from datetime import datetime
     from pyEX.stats import daily
     with patch('requests.get') as mock:
         mock.return_value = MagicMock()
         mock.return_value.status_code = 200
         daily()
         daily('201505')
         daily(last='5')
         daily(datetime.today())