Ejemplo n.º 1
0
    def test_symbolsDF(self):
        from pyEX.refdata import symbolsDF
        from pyEX import Client
        with patch('requests.get') as mock, \
                patch('pickle.dump'):
            mock.return_value = MagicMock()
            mock.return_value.status_code = 200
            mock.return_value.json = MagicMock(return_value=[])
            c = Client(version='sandbox')
            symbolsDF()
            c.iexSymbolsDF()
            c.mutualFundSymbolsDF()
            c.otcSymbolsDF()
            c.internationalSymbolsDF()
            c.internationalSymbolsDF('GB')
            c.internationalSymbolsDF(exchange='test')

            c.symbolsList()
            c.iexSymbolsList()
            c.mutualFundSymbolsList()
            c.otcSymbolsList()
            c.internationalSymbolsList()
            c.internationalSymbolsList('GB')
            c.internationalSymbolsList(exchange='test')

            mock.return_value.json = MagicMock(return_value={
                'currencies': [],
                'pairs': []
            })
            c.fxSymbolsDF()
            c.fxSymbolsList()
Ejemplo n.º 2
0
    def test_symbolsDF(self):
        from pyEX import Client
        from pyEX.refdata import symbolsDF

        with patch("requests.get") as mock:
            mock.return_value = MagicMock()
            mock.return_value.status_code = 200
            mock.return_value.json = MagicMock(return_value=[])
            c = Client(version="sandbox")
            symbolsDF()
            c.iexSymbolsDF()
            c.mutualFundSymbolsDF()
            c.otcSymbolsDF()
            c.internationalSymbolsDF()
            c.internationalSymbolsDF("GB")
            c.internationalSymbolsDF(exchange="test")

            c.symbolsList()
            c.iexSymbolsList()
            c.mutualFundSymbolsList()
            c.otcSymbolsList()
            c.internationalSymbolsList()
            c.internationalSymbolsList("GB")
            c.internationalSymbolsList(exchange="test")

            mock.return_value.json = MagicMock(return_value={
                "currencies": [],
                "pairs": []
            })
            c.fxSymbolsDF()
            c.fxSymbolsList()
Ejemplo n.º 3
0
 def test_symbolsDF(self):
     from pyEX.refdata import symbolsDF
     with patch('requests.get') as mock:
         mock.return_value = MagicMock()
         mock.return_value.status_code = 200
         mock.return_value.json = MagicMock(return_value=[])
         symbolsDF()
Ejemplo n.º 4
0
    def test_symbolsDF(self):
        from pyEX.refdata import symbolsDF
        from pyEX import Client
        with patch('requests.get') as mock:
            mock.return_value = MagicMock()
            mock.return_value.status_code = 200
            mock.return_value.json = MagicMock(return_value=[])
            c = Client()
            symbolsDF()
            c.iexSymbolsDF()
            c.mutualFundSymbolsDF()
            c.otcSymbolsDF()
            c.internationalSymbolsDF()
            c.internationalSymbolsDF('GB')
            c.internationalSymbolsDF(exchange='test')
            c.fxSymbolsDF()

            c.symbolsList()
            c.iexSymbolsList()
            c.mutualFundSymbolsList()
            c.otcSymbolsList()
            c.internationalSymbolsList()
            c.internationalSymbolsList('GB')
            c.internationalSymbolsList(exchange='test')
            c.fxSymbolsList()
Ejemplo n.º 5
0
 def test_symbolsDF(self):
     from pyEX.refdata import symbolsDF
     symbolsDF()
Ejemplo n.º 6
0
 def test_symbolsDF(self):
     from pyEX.refdata import symbolsDF
     from pyEX import Client
     c = Client()
     symbolsDF()
     c.iexSymbolsDF()