예제 #1
0
    def test_symbols(self):
        from pyEX.refdata import (
            fxSymbols,
            iexSymbols,
            internationalSymbols,
            mutualFundSymbols,
            otcSymbols,
            symbols,
        )

        with patch("requests.get") as mock:
            mock.return_value = MagicMock()
            mock.return_value.status_code = 200
            symbols()
            iexSymbols()
            mutualFundSymbols()
            otcSymbols()
            internationalSymbols()
            internationalSymbols("GB")
            internationalSymbols(exchange="test")
            mock.return_value.json = MagicMock(return_value={
                "currencies": [],
                "pairs": []
            })
            fxSymbols()
예제 #2
0
 def test_symbols(self):
     from pyEX.refdata import symbols, iexSymbols, mutualFundSymbols, otcSymbols, internationalSymbols, fxSymbols
     with patch('requests.get') as mock:
         mock.return_value = MagicMock()
         mock.return_value.status_code = 200
         symbols()
         iexSymbols()
         mutualFundSymbols()
         otcSymbols()
         internationalSymbols()
         internationalSymbols('GB')
         internationalSymbols(exchange='test')
         fxSymbols()
예제 #3
0
 def test_symbols(self):
     from pyEX.refdata import symbols, iexSymbols, mutualFundSymbols, otcSymbols, internationalSymbols, fxSymbols
     with patch('requests.get') as mock, \
             patch('pickle.dump'):
         mock.return_value = MagicMock()
         mock.return_value.status_code = 200
         symbols()
         iexSymbols()
         mutualFundSymbols()
         otcSymbols()
         internationalSymbols()
         internationalSymbols('GB')
         internationalSymbols(exchange='test')
         mock.return_value.json = MagicMock(return_value={
             'currencies': [],
             'pairs': []
         })
         fxSymbols()