Repository: libcloud Updated Branches: refs/heads/trunk 12d4cf030 -> a37a02a80
Add tests and fixtures FCU GetProductType API Signed-off-by: Javier M. Mellid <jmun...@igalia.com> Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/797ef788 Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/797ef788 Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/797ef788 Branch: refs/heads/trunk Commit: 797ef7885255d549422fd360007c7c7f8411e570 Parents: dccaabd Author: Javier M. Mellid <jmun...@igalia.com> Authored: Tue Oct 4 12:14:24 2016 +0200 Committer: Anthony Shaw <anthonys...@apache.org> Committed: Fri Oct 7 13:23:41 2016 +1100 ---------------------------------------------------------------------- libcloud/test/compute/fixtures/fcu/ex_get_product_type.xml | 6 ++++++ libcloud/test/compute/test_ec2.py | 9 +++++++++ 2 files changed, 15 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/libcloud/blob/797ef788/libcloud/test/compute/fixtures/fcu/ex_get_product_type.xml ---------------------------------------------------------------------- diff --git a/libcloud/test/compute/fixtures/fcu/ex_get_product_type.xml b/libcloud/test/compute/fixtures/fcu/ex_get_product_type.xml new file mode 100644 index 0000000..e5ea50c --- /dev/null +++ b/libcloud/test/compute/fixtures/fcu/ex_get_product_type.xml @@ -0,0 +1,6 @@ +<GetProductTypeResponse + xmlns="http://api.outscale.com/wsdl/fcuext/2014-04-15/"> + <requestId>e37f7876-8379-4505-8c3c-73c500e34257</requestId> + <productTypeId>0002</productTypeId> + <description>Windows</description> +</GetProductTypeResponse> http://git-wip-us.apache.org/repos/asf/libcloud/blob/797ef788/libcloud/test/compute/test_ec2.py ---------------------------------------------------------------------- diff --git a/libcloud/test/compute/test_ec2.py b/libcloud/test/compute/test_ec2.py index f772518..bdeda9a 100644 --- a/libcloud/test/compute/test_ec2.py +++ b/libcloud/test/compute/test_ec2.py @@ -1810,6 +1810,10 @@ class FCUMockHttp(EC2MockHttp): body = self.fixtures.load('ex_describe_instance_types.xml') return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + def _GetProductType(self, method, url, body, headers): + body = self.fixtures.load('ex_get_product_type.xml') + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + class OutscaleFCUTests(LibcloudTestCase): @@ -1846,6 +1850,11 @@ class OutscaleFCUTests(LibcloudTestCase): self.assertTrue('68718428160' in it.values()) self.assertTrue(it['m3.large'] == '8050966528') + def test_ex_get_product_type(self): + product_type = self.driver.ex_get_product_type('ami-29ab9e54') + self.assertTrue(product_type['productTypeId'] == '0002') + self.assertTrue(product_type['description'] == 'Windows') + if __name__ == '__main__': sys.exit(unittest.main())