Пример #1
0
 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'])
Пример #2
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'
Пример #4
0
 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'