示例#1
0
    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.account_summary()
示例#2
0
    def json_with_error_block_raises_exception_test(self):
        def callback(resource, api_version, query_params):
            return json.loads("""{"errors": "foo"}""")

        connection = MockConnection(callback)
        a = Account(connection, 1)

        with self.assertRaises(ExecutionFailureException):
            a.account_summary()