Beispiel #1
0
	def test_unsuccessful_api_call(self):
		"""
		An unsuccessful API call should set the ClientAPI object's response to None.
		"""
		acct_id = "OU812" # we know this is a bad ID to call
		clientAPI = ClientAPI(self.url)
		clientAPI.get(acct_id)
		self.assertIsNone(clientAPI.response)
Beispiel #2
0
	def test_successful_api_call(self):
		"""
		A successful API call should set the ClientAPI object's response to the data returned by the API.
		"""
		acct_id = "12345" # we know this ID is a good ID to call
		clientAPI = ClientAPI(self.url)
		clientAPI.get(acct_id)
		self.assertDictEqual({"account_id":12345,"status":"good","created_on":"2011-01-12"}, clientAPI.response)