Mercurial > hg > vampy-host
diff test/test_plugin_metadata.py @ 139:aa96f69e2f14
Add support for process timestamp method to low-level api
author | Chris Cannam |
---|---|
date | Wed, 08 Jul 2015 11:37:06 +0100 |
parents | 4f590fc46ace |
children | c64295f1cc33 |
line wrap: on
line diff
--- a/test/test_plugin_metadata.py Wed Jul 08 11:36:42 2015 +0100 +++ b/test/test_plugin_metadata.py Wed Jul 08 11:37:06 2015 +0100 @@ -79,6 +79,23 @@ def test_parameterdescriptors(): plug = vh.load_plugin(plugin_key, rate, vh.ADAPT_NONE) assert plug.parameters[0]["identifier"] == "produce_output" + +def test_timestamp_method_fail(): + plug = vh.load_plugin(plugin_key, rate, vh.ADAPT_NONE) + try: + plug.set_process_timestamp_method(vh.SHIFT_DATA) + assert False + except Exception: + pass + +def test_timestamp_method_fail2(): + plug = vh.load_plugin(plugin_key, rate, vh.ADAPT_INPUT_DOMAIN) + # Not a freq-domain plugin: shouldn't throw, but should return false + assert (not plug.set_process_timestamp_method(vh.SHIFT_DATA)) + +def test_timestamp_method_succeed(): + plug = vh.load_plugin(plugin_key_freq, rate, vh.ADAPT_INPUT_DOMAIN) + assert plug.set_process_timestamp_method(vh.SHIFT_DATA) def test_setparameter(): plug = vh.load_plugin(plugin_key, rate, vh.ADAPT_NONE)