def test_plugin_exists_not(plugin_name): """Test that a non-existing plugin returns False for exists() Tests both for an existing module (posetta.lib.exceptions) and a non-existent module (posetta.lib.non_existent). """ assert not plugins.exists("posetta.lib", plugin_name)
def exists(reader_name: str) -> bool: """Check whether the given reader exists Args: reader_name: Name of reader. Returns: True if reader exists, False otherwise. """ return plugins.exists(package_name=__name__, plugin_name=reader_name)
def test_plugin_exists(): """Test that an existing plugin returns True for exists()""" package_name = "posetta.readers" plugin_name = plugins.list_all(package_name)[0] assert plugins.exists(package_name, plugin_name)