Skip to content

Instantly share code, notes, and snippets.

@rigelreyes
Created November 18, 2019 17:39
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save rigelreyes/893ca11ae988355a8d89ce438f12ff47 to your computer and use it in GitHub Desktop.
Save rigelreyes/893ca11ae988355a8d89ce438f12ff47 to your computer and use it in GitHub Desktop.
Sentinel Test files
import "time"
# Expect requests to only happen during work days (Monday through Friday)
# 0 for Sunday and 6 for Saturday
workdays = rule {
time.now.weekday > 0 and time.now.weekday < 6
}
# Expect requests to only happen during work hours (7:00 am - 6:00 pm)
workhours = rule {
time.now.hour > 7 and time.now.hour < 18
}
main = rule {
workdays and workhours
}
{
"global": {
"timespace": {
"weekday": 0,
"hour": 12
}
},
"test": {
"main": false
}
}
{
"global": {
"timespace": {
"weekday": 1,
"hour": 12
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment