Skip to content

Add a re-usable function for asserting that the outputs defined in a SOAR app.json are present in the results.data key returned by a SOAR action #4

@edthedev

Description

@edthedev

Context

We currently manually assert that data outputs declared in app.json are populated correctly after running a test.
Since the expected fields are encoded in the JSON data, it should be possible to write a helper method that, given the name of the function being tested, reads app.json and verifies that the resulting data dictionary contains the expected 'data' keys.

Changes such as techservicesillinois/secops-soar-tdx#101 would benefit from this helper.

Tasks

  • add a function that, given a handle_X function name, and the path to app.json, parses app.json and returns a list of expected output keys in the 'data' dictionary
  • add unit test(s) for this new function here
  • add a test somewhere that uses this new helper ( one of our SOAR apps, or our template repository )
  • add example code or links to examples to README or CONTRIBUTING in this repository, that show how to use this helper

Metadata

Metadata

Assignees

No one assigned

    Labels

    good to goReady to be worked during a sprint

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions