Add tests and fixtures FCU ModifyInstanceKeypair API Signed-off-by: Javier M. Mellid <jmun...@igalia.com> Closes #890
Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/4fb3bc3b Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/4fb3bc3b Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/4fb3bc3b Branch: refs/heads/trunk Commit: 4fb3bc3baf7d267ebbee1936d6c156e7409c343d Parents: 797ef78 Author: Javier M. Mellid <jmun...@igalia.com> Authored: Tue Oct 4 12:32:09 2016 +0200 Committer: Anthony Shaw <anthonys...@apache.org> Committed: Fri Oct 7 13:23:44 2016 +1100 ---------------------------------------------------------------------- .../test/compute/fixtures/fcu/ex_modify_instance_keypair.xml | 5 +++++ libcloud/test/compute/test_ec2.py | 8 ++++++++ 2 files changed, 13 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/libcloud/blob/4fb3bc3b/libcloud/test/compute/fixtures/fcu/ex_modify_instance_keypair.xml ---------------------------------------------------------------------- diff --git a/libcloud/test/compute/fixtures/fcu/ex_modify_instance_keypair.xml b/libcloud/test/compute/fixtures/fcu/ex_modify_instance_keypair.xml new file mode 100644 index 0000000..bb11a17 --- /dev/null +++ b/libcloud/test/compute/fixtures/fcu/ex_modify_instance_keypair.xml @@ -0,0 +1,5 @@ +<ModifyInstanceKeypairResponse + xmlns="http://api.outscale.com/wsdl/fcuext/2014-04-15/"> + <requestId>9be5a40b-5f0a-4761-89fb-770eada0c865</requestId> + <return>true</return> +</ModifyInstanceKeypairResponse> http://git-wip-us.apache.org/repos/asf/libcloud/blob/4fb3bc3b/libcloud/test/compute/test_ec2.py ---------------------------------------------------------------------- diff --git a/libcloud/test/compute/test_ec2.py b/libcloud/test/compute/test_ec2.py index bdeda9a..466c0df 100644 --- a/libcloud/test/compute/test_ec2.py +++ b/libcloud/test/compute/test_ec2.py @@ -1814,6 +1814,10 @@ class FCUMockHttp(EC2MockHttp): body = self.fixtures.load('ex_get_product_type.xml') return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + def _ModifyInstanceKeypair(self, method, url, body, headers): + body = self.fixtures.load('ex_modify_instance_keypair.xml') + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + class OutscaleFCUTests(LibcloudTestCase): @@ -1855,6 +1859,10 @@ class OutscaleFCUTests(LibcloudTestCase): self.assertTrue(product_type['productTypeId'] == '0002') self.assertTrue(product_type['description'] == 'Windows') + def test_ex_modify_instance_keypair(self): + r = self.driver.ex_modify_instance_keypair('i-57292bc5', 'key_name') + self.assertTrue(r) + if __name__ == '__main__': sys.exit(unittest.main())