Example #1
0
 def test(self):
     act = quandl_utils._make_dataset_codes_url(
             database='ASX',
             auth_token='fake-token')
     exp = 'https://www.quandl.com/api/v3/databases/ASX/codes' + \
           '?api_key=fake-token'
     self.assertEqual(act, exp)
Example #2
0
 def test(self, requests_get):
     with open(self.zip_file, 'r') as fp:
         content = fp.read()
     requests_get.return_value = mock.Mock(content=content)
     # Test return value
     act = quandl_utils.get_available_dataset_codes(
             database='ASX')
     exp = self.dataset_codes
     pdt.assert_frame_equal(act, exp)
     # Test URL call
     exp_url = quandl_utils._make_dataset_codes_url(
                 database='ASX',
                 auth_token=None)
     requests_get.assert_called_with(exp_url)
Example #3
0
 def test_no_auth_token(self):
     act = quandl_utils._make_dataset_codes_url(
             database='ASX')
     exp = 'https://www.quandl.com/api/v3/databases/ASX/codes'
     self.assertEqual(act, exp)