コード例 #1
0
 def runTest(self):
     expected_headers = {
         'Content-Type': 'application/json',
         'bitcodin-api-key': bitcodin.api_key
     }
     headers = bitcodin.create_headers()
     self.assertDictEqual(expected_headers, headers)
コード例 #2
0
 def runTest(self):
     response = RestClient.get(url=bitcodin.get_api_base()+'/statistics/2000-12-24/2100-12-24', headers=bitcodin.create_headers())
コード例 #3
0
 def runTest(self):
     with self.assertRaises(BitcodinNotFoundError):
         response = RestClient.get(url=bitcodin.get_api_base(), headers=bitcodin.create_headers())
コード例 #4
0
 def runTest(self):
     with self.assertRaises(BitcodinUnknownApiRequestUrlError):
         response = RestClient.get(url=bitcodin.get_api_base(), headers=bitcodin.create_headers())
コード例 #5
0
 def runTest(self):
     with self.assertRaises(BitcodinApiKeyNotAuthorizedError):
         response = RestClient.get(url=bitcodin.get_api_base(),
                                   headers=bitcodin.create_headers())
コード例 #6
0
    def test_create_headers(self):
        headers = {"Content-Type": "application/json", "bitcodin-api-key": bitcodin.api_key}
        header_created = bitcodin.create_headers()

        self.assertDictEqual(headers, header_created)