def testArtifactsDependencies(self):
    artifact_reg = artifact_registry.REGISTRY

    art_obj = artifact_reg.GetArtifact("TestAggregationArtifactDeps")
    deps = art_obj.GetArtifactDependencies()
    self.assertItemsEqual(list(deps), ["TestAggregationArtifact"])

    deps = art_obj.GetArtifactDependencies(recursive=True)
    self.assertItemsEqual(list(deps),
                          ["TestOSAgnostic", "TestCmdArtifact",
                           "TestAggregationArtifact"])

    # Test recursive loop.
    # Make sure we use the registry registered version of the class.
    source = art_obj.sources[0]
    backup = source.attributes["names"]
    try:
      source.attributes["names"] = ["TestAggregationArtifactDeps"]
      with self.assertRaises(RuntimeError) as e:
        deps = art_obj.GetArtifactDependencies(recursive=True)
      self.assertTrue("artifact recursion depth" in e.exception.message)
    finally:
      source.attributes["names"] = backup   # Restore old source.
Subscription create page renders successfully.
dataset/ETHPy150Open google/grr/grr/lib/artifact_utils_test.py/ArtifactHandlingTest.testArtifactsDependencies--crossover with--dataset/ETHPy150Open nickjj/build-a-saas-app-with-flask/catwatch/tests/billing/test_views.py/TestBilling.test_subscription_create_page