Mercurial > hg > vampy-host
comparison test/test_plugin_metadata.py @ 52:b56513f872a5
Move files into subdirs
author | Chris Cannam |
---|---|
date | Wed, 14 Jan 2015 08:30:47 +0000 |
parents | test_plugin_metadata.py@a78b14c41c74 |
children | 61701d895082 |
comparison
equal
deleted
inserted
replaced
51:a78b14c41c74 | 52:b56513f872a5 |
---|---|
1 | |
2 import vampyhost as vh | |
3 | |
4 testPluginKey = "vamp-test-plugin:vamp-test-plugin" | |
5 | |
6 rate = 44100 | |
7 | |
8 def test_getoutputlist(): | |
9 outputs = vh.getOutputsOf(testPluginKey) | |
10 assert len(outputs) == 9 | |
11 assert "input-summary" in outputs | |
12 | |
13 def test_inputdomain(): | |
14 plug = vh.loadPlugin(testPluginKey, rate, vh.AdaptNone) | |
15 assert plug.inputDomain == vh.TimeDomain | |
16 | |
17 def test_info(): | |
18 plug = vh.loadPlugin(testPluginKey, rate, vh.AdaptNone) | |
19 assert plug.info["identifier"] == "vamp-test-plugin" | |
20 | |
21 def test_parameterdescriptors(): | |
22 plug = vh.loadPlugin(testPluginKey, rate, vh.AdaptNone) | |
23 assert plug.parameters[0]["identifier"] == "produce_output" | |
24 | |
25 def test_setparameter(): | |
26 plug = vh.loadPlugin(testPluginKey, rate, vh.AdaptNone) | |
27 assert plug.parameters[0]["identifier"] == "produce_output" | |
28 assert plug.parameters[0]["defaultValue"] == 1 | |
29 assert plug.getParameterValue("produce_output") == plug.parameters[0]["defaultValue"] | |
30 assert plug.setParameterValue("produce_output", 0) == True | |
31 assert plug.getParameterValue("produce_output") == 0 | |
32 assert plug.setParameterValues({ "produce_output": 1 }) == True | |
33 assert plug.getParameterValue("produce_output") == 1 | |
34 try: | |
35 plug.setParameterValue("produce_output", "fish") | |
36 assert False | |
37 except TypeError: | |
38 pass | |
39 try: | |
40 plug.setParameterValue(4, 0) | |
41 assert False | |
42 except TypeError: | |
43 pass | |
44 try: | |
45 plug.setParameterValue("steak", 0) | |
46 assert False | |
47 except StandardError: | |
48 pass | |
49 try: | |
50 plug.getParameterValue(4) | |
51 assert False | |
52 except TypeError: | |
53 pass | |
54 try: | |
55 plug.getParameterValue("steak") | |
56 assert False | |
57 except StandardError: | |
58 pass | |
59 |