Example #1
0
    def test_collections(self):
        from pyEX import collections
        from pyEX.common import PyEXception
        with patch('requests.get') as mock:
            mock.return_value = MagicMock()
            mock.return_value.status_code = 200
            collections('sector', 'test')

            try:
                collections('test', 'test')
                assert False
            except PyEXception:
                pass
Example #2
0
    def test_collections(self):
        from pyEX import collections
        from pyEX.common import PyEXception

        with patch("requests.get") as mock, patch("pickle.dump"):
            mock.return_value = MagicMock()
            mock.return_value.status_code = 200
            collections("sector", "test")

            try:
                collections("test", "test")
                assert False
            except PyEXception:
                pass