Skip to content

Commit

Permalink
def'd out test-specific constants
Browse files Browse the repository at this point in the history
  • Loading branch information
milt committed Jan 23, 2024
1 parent e0bcfb1 commit dc2e04c
Showing 1 changed file with 17 additions and 12 deletions.
29 changes: 17 additions & 12 deletions src/test/lrsql/lrs_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -1032,6 +1032,21 @@
;; Statement Reaction Tests
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(def invalid-template-invalid-path
{"actor" {"mbox" {"$templatePath" ["x" "actor" "mbox"]}}
"verb" {"id" "https://example.com/verbs/completed"}
"object" {"id" "https://example.com/activities/a-and-b"
"objectType" "Activity"}})

(def reaction-statement-result
{"actor" {"mbox" "mailto:[email protected]"},
"verb" {"id" "https://example.com/verbs/completed"},
"object"
{"id" "https://example.com/activities/a-and-b",
"objectType" "Activity"}
"context"
{"extensions" {"https://example.com/foo" nil}}})

(defn- remove-id
[statement]
(dissoc statement "id"))
Expand All @@ -1051,11 +1066,7 @@
(assoc
tc/simple-reaction-ruleset
:template
;; Template with invalid path
{"actor" {"mbox" {"$templatePath" ["x" "actor" "mbox"]}}
"verb" {"id" "https://example.com/verbs/completed"}
"object" {"id" "https://example.com/activities/a-and-b"
"objectType" "Activity"}})
invalid-template-invalid-path)
{bad-reaction-id
:result} (adp/-create-reaction
lrs "reaction-bad" bad-ruleset true)]
Expand All @@ -1069,13 +1080,7 @@
(testing "New statement added"
(is (= {:statement-result
{:statements
[{"actor" {"mbox" "mailto:[email protected]"},
"verb" {"id" "https://example.com/verbs/completed"},
"object"
{"id" "https://example.com/activities/a-and-b",
"objectType" "Activity"}
"context"
{"extensions" {"https://example.com/foo" nil}}}
[reaction-statement-result
(remove-id tc/reaction-stmt-b)
(remove-id tc/reaction-stmt-a)]
:more ""}
Expand Down

0 comments on commit dc2e04c

Please sign in to comment.