grr/server/grr_response_server/flows/general/collectors_test.py
def testArtifactWithBasicDependency(self):
    """Test that an artifact providing the dependency is added to the list."""

    self.cleanup = InitGRRWithTestSources("""
name: Artifact0
doc: An artifact without dependencies.
supported_os: [Linux]
provides: ["users.desktop"]
---
name: Artifact1
doc: An artifact that depends on Artifact0.
sources:
- type: FILE
  attributes:
    paths:
      - '/sample/path'
      - '/%%users.desktop%%/'
supported_os: [Linux]
""")

    artifact_arranger = collectors.ArtifactArranger(
        os_name="Linux", artifacts_name_list=["Artifact1"])
    artifact_list = artifact_arranger.GetArtifactsInProperOrder()
    self.assertEqual(artifact_list, ["Artifact0", "Artifact1"])
Test that an artifact providing the dependency is added to the list.
Test that an artifact providing the dependency is added to the list.
Test that an artifact providing the dependency is added to the list .
def testArtifactWithBasicDependency(self):
    self.cleanup = InitGRRWithTestSources("""
name: Artifact0
doc: An artifact without dependencies.
supported_os: [Linux]
provides: ["users.desktop"]
---
name: Artifact1
doc: An artifact that depends on Artifact0.
sources:
- type: FILE
  attributes:
    paths:
      - '/sample/path'
      - '/%%users.desktop%%/'
supported_os: [Linux]
""")
    artifact_arranger = collectors.ArtifactArranger(
        os_name="Linux", artifacts_name_list=["Artifact1"])
    artifact_list = artifact_arranger.GetArtifactsInProperOrder()
    self.assertEqual(artifact_list, ["Artifact0", "Artifact1"])
def testArtifactWithBasicDependency ( self ) : self . cleanup = InitGRRWithTestSources ( """
name: Artifact0
doc: An artifact without dependencies.
supported_os: [Linux]
provides: ["users.desktop"]
---
name: Artifact1
doc: An artifact that depends on Artifact0.
sources:
- type: FILE
  attributes:
    paths:
      - '/sample/path'
      - '/%%users.desktop%%/'
supported_os: [Linux]
""" ) artifact_arranger = collectors . ArtifactArranger ( os_name = "Linux" , artifacts_name_list = [ "Artifact1" ] ) artifact_list = artifact_arranger . GetArtifactsInProperOrder ( ) self . assertEqual ( artifact_list , [ "Artifact0" , "Artifact1" ] )
Test that an artifact providing the dependency is added to the list.
Test that an artifact providing the dependency is added to the list .
"""Test that an artifact providing the dependency is added to the list."""
self