def testGetArtifacts(self):
    self._LoadAllArtifacts()

    results = artifact_registry.REGISTRY.GetArtifacts(os_name="Windows")
    for result in results:
      self.assertTrue("Windows" in result.supported_os or
                      not result.supported_os)

    results = artifact_registry.REGISTRY.GetArtifacts(
        os_name="Windows", name_list=[
            "TestAggregationArtifact", "TestFileArtifact"])

    # TestFileArtifact doesn't match the OS criteria
    self.assertItemsEqual([x.name for x in results],
                          ["TestAggregationArtifact"])
    for result in results:
      self.assertTrue("Windows" in result.supported_os and
                      not result.supported_os)

    results = artifact_registry.REGISTRY.GetArtifacts(
        os_name="Windows",
        source_type=artifact_registry.ArtifactSource.SourceType.REGISTRY_VALUE,
        name_list=["DepsProvidesMultiple"])
    self.assertEqual(results.pop().name, "DepsProvidesMultiple")

    # Check supported_os = [] matches any OS
    results = artifact_registry.REGISTRY.GetArtifacts(
        os_name="Windows", name_list=["RekallPsList"])
    self.assertEqual(len(results), 1)
    self.assertEqual(results.pop().name, "RekallPsList")

    results = artifact_registry.REGISTRY.GetArtifacts(
        os_name="Windows", exclude_dependents=True)
    for result in results:
      self.assertFalse(result.GetArtifactPathDependencies())

    # Check provides filtering
    results = artifact_registry.REGISTRY.GetArtifacts(
        os_name="Windows", provides=["users.homedir", "domain"])
    for result in results:
      # provides contains at least one of the filter strings
      self.assertTrue(len(set(result.provides).union(set(["users.homedir",
                                                          "domain"]))) >= 1)

    results = artifact_registry.REGISTRY.GetArtifacts(
        os_name="Windows", provides=["nothingprovidesthis"])
    self.assertEqual(len(results), 0)
dataset/ETHPy150Open google/grr/grr/lib/artifact_utils_test.py/ArtifactHandlingTest.testGetArtifacts/operator `or` -> `and`