def setUpClass(cls):
     httpretty.enable()
     database = {'database': DatabaseFactory.build(database_code='NSE')}
     httpretty.register_uri(httpretty.GET,
                            re.compile(
                                'https://www.quandl.com/api/v3/databases/*'),
                            body=json.dumps(database))
     cls.db_instance = Database(Database.get_code_from_meta(
         database['database']), database['database'])
 def setUpClass(cls):
     httpretty.enable()
     databases = {'databases': DatabaseFactory.build_batch(10)}
     meta = {'meta': MetaFactory.build()}
     databases.update(meta)
     httpretty.register_uri(httpretty.GET,
                            re.compile(
                                'https://www.quandl.com/api/v3/databases*'),
                            body=json.dumps(databases))
     cls.expected_databases = databases
Example #3
0
    def setUp(self):
        httpretty.enable()
        httpretty.register_uri(httpretty.GET,
                               re.compile(
                                   'https://www.quandl.com/api/v3/databases/*'),
                               adding_headers={
                                   'Location': 'https://www.blah.com/download/db.zip'
                               },
                               body='{}', status=302)
        httpretty.register_uri(httpretty.GET,
                               re.compile('https://www.blah.com/'), body='{}')

        database = {'database': DatabaseFactory.build(database_code='NSE')}
        self.database = Database(database['database']['database_code'], database['database'])
        ApiConfig.api_key = 'api_token'
        ApiConfig.api_version = '2015-04-09'
    def setUp(self):
        httpretty.enable()
        httpretty.register_uri(
            httpretty.GET,
            re.compile('https://www.quandl.com/api/v3/databases/*'),
            adding_headers={
                'Location': 'https://www.blah.com/download/db.zip'
            },
            body='{}',
            status=302)
        httpretty.register_uri(httpretty.GET,
                               re.compile('https://www.blah.com/'),
                               body='{}')

        database = {'database': DatabaseFactory.build(database_code='NSE')}
        self.database = Database(database['database']['database_code'],
                                 database['database'])
        ApiConfig.api_key = 'api_token'
        ApiConfig.api_version = '2015-04-09'
 def setUp(self):
     database = {'database': DatabaseFactory.build(database_code='NSE')}
     self.database = Database(database['database']['database_code'], database['database'])
     ApiConfig.api_key = 'api_token'
     ApiConfig.api_version = '2015-04-09'