From 7c4850d2977f80308b0de8274c545123fd2c95ac Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 21 Oct 2019 19:20:18 +0200 Subject: Fix memory errors and Python 3.4+ compatibility in Python bindings --- bindings/test/python/test_api.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'bindings/test') diff --git a/bindings/test/python/test_api.py b/bindings/test/python/test_api.py index ab0a1a4..91cc814 100644 --- a/bindings/test/python/test_api.py +++ b/bindings/test/python/test_api.py @@ -158,8 +158,6 @@ class PluginTests(unittest.TestCase): self.assertEqual( self.plugin.get_uri(), self.plugin_uri, "URI equality broken" ) - self.instance = lilv.Instance(self.plugin, 48000, None) - self.assertIsNotNone(self.instance) self.lv2_InputPort = self.world.new_uri(lilv.LILV_URI_INPUT_PORT) self.lv2_OutputPort = self.world.new_uri(lilv.LILV_URI_OUTPUT_PORT) self.lv2_AudioPort = self.world.new_uri(lilv.LILV_URI_AUDIO_PORT) @@ -262,10 +260,10 @@ class PluginTests(unittest.TestCase): def testScalePoints(self): port = self.plugin.get_port("input") points = port.get_scale_points() - self.assertEqual(points[0].get_label(), "off") - self.assertEqual(points[0].get_value(), 0.0) - self.assertEqual(points[1].get_label(), "on") - self.assertEqual(points[1].get_value(), 1.0) + point_dict = { float(points[0].get_value()): points[0].get_label(), + float(points[1].get_value()): points[1].get_label() } + + self.assertEqual(point_dict, {0.0: "off", 1.0: "on"}) def testPortCount(self): self.assertEqual( -- cgit v1.2.1