def test_matches(self, plugin, yaml_dict): pm = self._get_plugin_match(plugin, yaml_dict) # More than one value could be asserted, then we need to create this dict asserter = { k: v for k, v in yaml_dict.items() if k in ["version", "name", "presence"] } assert pm == create_pm(**asserter)
def test_real_generic_plugin( self, plugin_name, matcher_type, har_content, name, plugins ): plugin = plugins.get(plugin_name) har_entry = create_har_entry(matcher_type, value=har_content) # Verify presence using matcher class matchers = plugin.get_matchers(matcher_type) matcher_class = MATCHERS[matcher_type] assert matcher_class.get_info(har_entry, *matchers) == create_pm(presence=True) assert plugin.get_information(har_entry)["name"] == name
def test_get_version_with_har(self, entry): version_re = r"foo-(?P<version>[\d\.]+)" assert UrlMatcher.get_info(entry, version_re) == create_pm(version="1.1")
def test_get_name(self, matcher_class, entry, matcher, name): assert matcher_class.get_info(entry, matcher) == create_pm(name=name)
def test_get_presence(self, matcher_class, entry, matcher, presence): assert matcher_class.get_info(entry, matcher) == create_pm(presence=presence)
def test_get_version(self, matcher_class, entry, matcher, version): assert matcher_class.get_info(entry, matcher) == create_pm(version=version)