diff --git a/dev-resources/personae/temporal.json b/dev-resources/personae/temporal.json index 1bb4e302..c17238e2 100644 --- a/dev-resources/personae/temporal.json +++ b/dev-resources/personae/temporal.json @@ -1,13 +1,11 @@ -[ - { - "name": "Singleton Group", - "objectType": "Group", - "member": [ - { - "name": "Lain Iwakura", - "mbox": "mailto:lain@yetanalytics.org", - "role": "God of the Wired" - } - ] - } -] +{ + "name": "Singleton Group", + "objectType": "Group", + "member": [ + { + "name": "Lain Iwakura", + "mbox": "mailto:lain@yetanalytics.org", + "role": "God of the Wired" + } + ] +} diff --git a/src/cli/com/yetanalytics/datasim/cli/input.clj b/src/cli/com/yetanalytics/datasim/cli/input.clj index 24695115..00f9ed98 100644 --- a/src/cli/com/yetanalytics/datasim/cli/input.clj +++ b/src/cli/com/yetanalytics/datasim/cli/input.clj @@ -27,6 +27,10 @@ (def validated-input-desc "The location of the validated input to be produced. If not provided, the validated input will be printed to stdout instead.") +;; TODO: Update `:profiles` input to accept both single objects and arrays. +;; TODO: Update `:personae-array` input to accept both single objects and arrays +;; (and rename to just `:personaes`). + ;; NOTE: For the `validate-input` subcommand, we skip tools.cli validation and ;; do more in-depth validation involving combined inputs. (def validate-input-options diff --git a/src/test/com/yetanalytics/datasim/input/personae_test.clj b/src/test/com/yetanalytics/datasim/input/personae_test.clj index 078f08d9..ca2174da 100644 --- a/src/test/com/yetanalytics/datasim/input/personae_test.clj +++ b/src/test/com/yetanalytics/datasim/input/personae_test.clj @@ -14,6 +14,9 @@ (def tc3-personae (dio/read-json-location const/tc3-personae-filepath)) +(def temporal-personae + (dio/read-json-location const/temporal-personae-filepath)) + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Tests ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -21,7 +24,8 @@ (deftest personae-test (testing "personae without roles" (is (nil? (personae/validate-personae simple-personae))) - (is (nil? (personae/validate-personae tc3-personae)))) + (is (nil? (personae/validate-personae tc3-personae))) + (is (nil? (personae/validate-personae temporal-personae)))) (testing "personae with roles" (is (nil? (-> simple-personae (assoc-in [:member 0 :role] "Lead Developer") diff --git a/src/test/com/yetanalytics/datasim/test_constants.clj b/src/test/com/yetanalytics/datasim/test_constants.clj index d4810e7b..d20a7a5a 100644 --- a/src/test/com/yetanalytics/datasim/test_constants.clj +++ b/src/test/com/yetanalytics/datasim/test_constants.clj @@ -134,8 +134,8 @@ (def tc3-personae (input/from-location :personae :json tc3-personae-filepath)) -(def temporal-personaes - (input/from-location :personae-array :json temporal-personae-filepath)) +(def temporal-personae + (input/from-location :personae :json temporal-personae-filepath)) ;; Models @@ -166,7 +166,7 @@ (zipmap temporal-models-filepath-coll* (map (fn [temporal-model] {:profiles [temporal-profile] - :personae-array temporal-personaes + :personae-array [temporal-personae] :parameters temporal-parameters :models temporal-model}) temporal-models-coll)))