async def test_wolfram_api_call_named_image(self): api = (self.api_owner, "api/private/imagedimensions") apicall = WolframAPICallAsync(self.cloud_session_async, api) with open(self.get_data_path("32x2.png"), "rb") as fp: apicall.add_file_parameter("image", fp, filename="testimage") res = await apicall.perform() self.assertTrue(res.success) res = await res.get() self.assertEqual(res, [32, 2])
async def test_wolfram_api_call_named_image(self): api = (self.api_owner, 'api/private/imagedimensions') apicall = WolframAPICallAsync(self.cloud_session_async, api) with open(self.get_data_path('32x2.png'), 'rb') as fp: apicall.add_file_parameter('image', fp, filename='testimage') res = await apicall.perform() self.assertTrue(res.success) res = await res.get() self.assertListEqual(res, [32, 2])
async def test_wolfram_api_image_string_int(self): api = (self.api_owner, "api/private/str_image_int") with open(self.get_data_path("32x2.png"), "rb") as fp: apicall = WolframAPICallAsync(self.cloud_session_async, api) apicall.set_parameter("str", "abc") apicall.set_parameter("int", 10) apicall.add_file_parameter("image", fp) result = await apicall.perform() res = await result.get() self.assertEqual(res, ["abc", [32, 2], 10])
async def test_wolfram_api_image_string_int(self): api = (self.api_owner, 'api/private/str_image_int') with open(self.get_data_path('32x2.png'), 'rb') as fp: apicall = WolframAPICallAsync(self.cloud_session_async, api) apicall.set_parameter('str', 'abc') apicall.set_parameter('int', 10) apicall.add_file_parameter('image', fp) result = await apicall.perform() res = await result.get() self.assertListEqual(res, ['abc', [32, 2], 10])