From notifications-return-14338-archive-asf-public=cust-asf.ponee.io@libcloud.apache.org Sun Feb 25 06:03:00 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 7626F18067E for ; Sun, 25 Feb 2018 06:02:59 +0100 (CET) Received: (qmail 97478 invoked by uid 500); 25 Feb 2018 05:02:58 -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 97298 invoked by uid 500); 25 Feb 2018 05:02:57 -0000 Delivered-To: apmail-libcloud-commits@libcloud.apache.org Received: (qmail 97287 invoked by uid 99); 25 Feb 2018 05:02:57 -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; Sun, 25 Feb 2018 05:02:57 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id B14EBF21A2; Sun, 25 Feb 2018 05:02:53 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: quentinp@apache.org To: commits@libcloud.apache.org Date: Sun, 25 Feb 2018 05:02:56 -0000 Message-Id: <37bfcc00b59e47b0aff91c9c578fa940@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [4/8] libcloud git commit: Add test for internal ip creation for GCP Add test for internal ip creation for GCP Signed-off-by: Quentin Pradet Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/7a5abfa9 Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/7a5abfa9 Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/7a5abfa9 Branch: refs/heads/trunk Commit: 7a5abfa9de3c9442a7db189bbd1f662b80c680cf Parents: efb296d Author: Jeremy Solarz Authored: Fri Feb 23 19:06:31 2018 +0000 Committer: Quentin Pradet Committed: Sun Feb 25 09:00:55 2018 +0400 ---------------------------------------------------------------------- libcloud/test/compute/test_gce.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/libcloud/blob/7a5abfa9/libcloud/test/compute/test_gce.py ---------------------------------------------------------------------- diff --git a/libcloud/test/compute/test_gce.py b/libcloud/test/compute/test_gce.py index f9e33ff..82a2e64 100644 --- a/libcloud/test/compute/test_gce.py +++ b/libcloud/test/compute/test_gce.py @@ -735,6 +735,19 @@ class GCENodeDriverTest(GoogleTestCase, TestCaseMixin): self.assertTrue(isinstance(address, GCEAddress)) self.assertEqual(address.name, address_name) + def test_ex_create_address_internal(self): + address_name = 'lcaddressinternal' + address = self.driver.ex_create_address(address_name, + region='us-central1', + address='10.128.0.12', + address_type='INTERNAL', + subnetwork='subnet-1') + print address + self.assertTrue(isinstance(address, GCEAddress)) + self.assertEqual(address.name, address_name) + self.assertEqual(address.address, '10.128.0.12') + self.assertEqual(address.addressType, 'INTERNAL') + def test_ex_create_backend(self): # Note: this is an internal object, no API call is made # and no fixture is needed specifically for GCEBackend, however @@ -3011,6 +3024,16 @@ class GCEMockHttp(MockHttp): body = self.fixtures.load('regions_us-central1_addresses_testaddress.json') return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) + def _regions_us_central1_subnetworks_subnet_1(self, method, url, body, + headers): + body = self.fixtures.load('regions_us-central1_subnetworks_subnet_1.json') + return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) + + def _regions_us_central1_addresses_lcaddressinternal(self, method, url, body, + headers): + body = self.fixtures.load('regions_us-central1_addresses_lcaddressinternal.json') + return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK]) + def _regions_us_central1_forwardingRules(self, method, url, body, headers): if method == 'POST': body = self.fixtures.load(