Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_init():
data_timeseries_empty = dict(
filename="file",
field="field",
)
vaping.plugin.get_plugin_class("graphite")(data_timeseries_empty, None)
def test_include():
vaping.plugin.get_plugin_class('zeromq')
# inst = cls()
def test_plugin_default_config():
cls = plugin.get_plugin_class("probe0")
probe = cls({}, None)
assert probe.pluginmgr_config == cls.default_config
def test_parse_traceroute(data_mtr_traceroute):
mtr = vaping.plugin.get_plugin_class("fping_mtr")({}, None)
print(data_mtr_traceroute.input)
print(data_mtr_traceroute.expected)
print("=======")
hosts = mtr.parse_traceroute(data_mtr_traceroute.input.splitlines())
print("HOSTS: {}".format(hosts))
# XXX need to refactor to properly test if host and hosts not in host
assert_parsed(data_mtr_traceroute, hosts)
def test_plugin_registry():
assert Plugin0 == plugin.get_plugin_class('plugin0')
with pytest.raises(ValueError):
plugin.get_plugin_class('nonexistant')
with pytest.raises(ValueError):
@plugin.register('plugin0')
class p0(plugins.PluginBase):
pass