Skip to content

Instantly share code, notes, and snippets.

@cneill
Last active July 14, 2016 20:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cneill/d004a865f5bfd5ad056fbf86184ba16a to your computer and use it in GitHub Desktop.
Save cneill/d004a865f5bfd5ad056fbf86184ba16a to your computer and use it in GitHub Desktop.

Signals Convenience Methods / etc.

SynSignal

  • add the check that this signal came from - this lets us see if we've run a check, instead of checking for a particular slug or set of slugs (e.g. HTTP_STATUS_CODE_* vs. HTTP_STATUS_CODE_5XX_501)
    • used by "ran_check" in SH

SignalHolder

  • find(tags=[], slugs=[])

    • allow wildcards (e.g. HTTP_STATUS_CODE_5XX_* or CORS_*_WILDCARD)
    • returns: SignalHolder([matched signals])
  • __eq__(other=SignalHolder())

    • determine whether the signals contained in this SH are the same as those supplied in "other"
    • returns: True/False
  • diff(other=SignalHolder())

    • return a set of signals that differ between two SignalHolders
    • create new signals? i.e. HTTP_STATUS_CODE_DIFFERS ?
    • returns: SignalHolder([different signals])
  • ran_check(check_name=str)

    • determine whether a given check was already run and appended to this SignalHolder
    • returns: True/False
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment