Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 915B5200C61 for ; Tue, 11 Apr 2017 01:45:52 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 8FD95160BA5; Mon, 10 Apr 2017 23:45:52 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id D7792160B99 for ; Tue, 11 Apr 2017 01:45:51 +0200 (CEST) Received: (qmail 88162 invoked by uid 500); 10 Apr 2017 23:45:51 -0000 Mailing-List: contact notifications-help@libcloud.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@libcloud.apache.org Delivered-To: mailing list notifications@libcloud.apache.org Received: (qmail 88153 invoked by uid 99); 10 Apr 2017 23:45:50 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 Apr 2017 23:45:50 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 9DB3BDFF9F; Mon, 10 Apr 2017 23:45:50 +0000 (UTC) From: tonybaloney To: notifications@libcloud.apache.org Reply-To: notifications@libcloud.apache.org Message-ID: Subject: [GitHub] libcloud pull request #1031: [WIP] Replace the HTTP mock methods with a tran... Content-Type: text/plain Date: Mon, 10 Apr 2017 23:45:50 +0000 (UTC) archived-at: Mon, 10 Apr 2017 23:45:52 -0000 GitHub user tonybaloney opened a pull request: https://github.com/apache/libcloud/pull/1031 [WIP] Replace the HTTP mock methods with a transport adapter ### Description This change is to the base test classes. At the moment they mock out the response, raw response and connection classes. Which is fine but it's led to issues that could have been uncovered in the unit tests because it doesn't represent how the drivers actually respond. This change will replace the mock connection and mock response classes with the actual implementations and use a `requests_mock` session context manager to get the response from the existing methods so hopefully I won't need to change each of the test classes. For more information on contributing, please see [Contributing](http://libcloud.readthedocs.org/en/latest/development.html#contributing) section of our documentation. ### Status Replace this: describe the PR status. Examples: - work in progress - done, ready for review ### Checklist (tick everything that applies) - [ ] [Code linting](http://libcloud.readthedocs.org/en/latest/development.html#code-style-guide) (required, can be done after the PR checks) - [ ] Documentation - [ ] [Tests](http://libcloud.readthedocs.org/en/latest/testing.html) - [ ] [ICLA](http://libcloud.readthedocs.org/en/latest/development.html#contributing-bigger-changes) (required for bigger changes) You can merge this pull request into a Git repository by running: $ git pull https://github.com/tonybaloney/libcloud mock_refactor Alternatively you can review and apply these changes as the patch at: https://github.com/apache/libcloud/pull/1031.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #1031 ---- commit 2540abb3fc815d0127124e2518f9aa60fd893282 Author: Anthony Shaw Date: 2017-04-10T23:41:21Z Replace the (ugly) HTTP mock methods with a transport adapter for requests. This will use the actual connection classes and probably uncover some bugs in the tests ---- --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastructure@apache.org or file a JIRA ticket with INFRA. ---