def testArtifactOutput(self):
    """Check we can run command based artifacts."""
    with test_lib.VFSOverrider(
        rdf_paths.PathSpec.PathType.OS, test_lib.FakeTestDataVFSHandler):
      # Will raise if something goes wrong.
      self.RunCollectorAndGetCollection(["TestFilesArtifact"],
                                        client_mock=self.client_mock)

      # Will raise if something goes wrong.
      self.RunCollectorAndGetCollection(["TestFilesArtifact"],
                                        client_mock=self.client_mock,
                                        split_output_by_artifact=True)

      # Test the on_no_results_error option.
      with self.assertRaises(RuntimeError) as context:
        self.RunCollectorAndGetCollection(
            ["NullArtifact"], client_mock=self.client_mock,
            split_output_by_artifact=True, on_no_results_error=True)
      if "collector returned 0 responses" not in str(context.exception):
        raise RuntimeError("0 responses should have been returned")
dataset/ETHPy150Open google/grr/grr/lib/artifact_test.py/ArtifactFlowLinuxTest.testArtifactOutput/original