comparison test/test_plugin_metadata.py @ 86:78844c4b329c

Add get_output
author Chris Cannam
date Wed, 21 Jan 2015 14:03:43 +0000
parents fbd084b81ece
children dd56716714e0
comparison
equal deleted inserted replaced
85:02956a88ee58 86:78844c4b329c
23 def test_getoutputlist(): 23 def test_getoutputlist():
24 outputs = vh.get_outputs_of(plugin_key) 24 outputs = vh.get_outputs_of(plugin_key)
25 assert len(outputs) == 10 25 assert len(outputs) == 10
26 assert "input-summary" in outputs 26 assert "input-summary" in outputs
27 27
28 def test_getoutputlist_2():
29 plug = vh.load_plugin(plugin_key, rate, vh.ADAPT_NONE)
30 outputs = plug.get_outputs()
31 assert len(outputs) == 10
32
33 def test_get_output_by_id():
34 plug = vh.load_plugin(plugin_key, rate, vh.ADAPT_NONE)
35 out = plug.get_output("input-summary")
36 assert "sample_type" in out
37 try:
38 out = plug.get_output("chops")
39 assert False
40 except StandardError:
41 pass
42 try:
43 out = plug.get_output("")
44 assert False
45 except StandardError:
46 pass
47
48 def test_get_output_by_index():
49 plug = vh.load_plugin(plugin_key, rate, vh.ADAPT_NONE)
50 out = plug.get_output(0)
51 assert "sample_type" in out
52 assert out["identifier"] == "instants"
53 try:
54 out = plug.get_output(20)
55 assert False
56 except StandardError:
57 pass
58 try:
59 out = plug.get_output(-1)
60 assert False
61 except StandardError:
62 pass
63 try:
64 out = plug.get_output(plug)
65 assert False
66 except StandardError:
67 pass
68
28 def test_inputdomain(): 69 def test_inputdomain():
29 plug = vh.load_plugin(plugin_key, rate, vh.ADAPT_NONE) 70 plug = vh.load_plugin(plugin_key, rate, vh.ADAPT_NONE)
30 assert plug.input_domain == vh.TIME_DOMAIN 71 assert plug.input_domain == vh.TIME_DOMAIN
31 72
32 def test_info(): 73 def test_info():