def valid_result_raises_no_exceptions_test(self): def callback(resource, api_version, query_params): return json.loads(self.__VALID_RESULT) connection = MockConnection(callback) a = Account(connection, 1) a.owned_notes()
def detailed_info_requests_data_from_detailednotes_test(self): def callback(resource, api_version, query_params): self.assertEquals('accounts/1/detailednotes', resource) return json.loads(self.__VALID_RESULT) connection = MockConnection(callback) a = Account(connection, 1) a.owned_notes(detailed_info=True)
def dates_are_converted_test(self): def callback(resource, api_version, query_params): return json.loads(self.__VALID_RESULT) connection = MockConnection(callback) a = Account(connection, 1) result = a.owned_notes() self.assertEquals(arrow.get("2009-11-12T06:34:02.000-08:00"), result[0]['issueDate'])
def no_notes_returns_empty_list_test(self): def callback(resource, api_version, query_params): return json.loads('{}') connection = MockConnection(callback) a = Account(connection, 1) result = a.owned_notes() self.assertEquals(list, type(result)) self.assertEquals(0, len(result))