Groups & Actions
3 test modules, 80 test cases. ← Back to overview
testGRP.py — Group (<GRP>) resource lifecycle and fanOut behavior (23 tests)
| # | Test Method | Requests Performed |
|---|---|---|
| 1 | test_createGRP |
CREATE a <GRP> under the <AE> with mt=MIXED, mnm=10, and mid referencing 2 <CNT>s -> expects CREATED. |
| 2 | test_retrieveGRP |
RETRIEVE the <GRP> -> expects OK. |
| 3 | test_retrieveGRPWithWrongOriginator |
RETRIEVE the <GRP> with an unauthorized originator -> expects ORIGINATOR_HAS_NO_PRIVILEGE. |
| 4 | test_attributesGRP |
RETRIEVE the <GRP> -> expects OK; checks ty, pi, rn, ct, lt, et, cr (absent), mt, mnm=10, cnm=2, mid (list of 2), and st (absent). |
| 5 | test_updateGRP |
UPDATE the <GRP> setting mnm=15 -> expects UPDATED; checks the returned mnm. |
| 6 | test_updateGRPwithCNT |
UPDATE the <GRP> with a body typed as m2m:cnt instead of m2m:grp -> expects something other than UPDATED. |
| 7 | test_addCNTtoGRP |
RETRIEVE the <GRP> -> expects OK, checks cnm=2; CREATE a 3rd <CNT> -> expects CREATED; UPDATE the <GRP>'s mid to add it -> expects UPDATED, checks cnm is now 3. |
| 8 | test_addCINviaFOPT |
CREATE a <CIN> via the group's fanOutPoint (/fopt) targeting all 3 member <CNT>s -> expects OK on the aggregated request, checks 3 individual CREATED responses; RETRIEVE each created <CIN> by its returned ri -> each expects OK; RETRIEVE each <CNT>'s la (latest) directly -> each expects OK with the matching con. |
| 9 | test_retrieveLAviaFOPT |
RETRIEVE the group's /fopt/la (latest of all 3 member <CNT>s) -> expects OK on the aggregated request, checks 3 individual OK responses, each RETRIEVE-verified directly by ri. |
| 10 | test_updateCNTviaFOPT |
UPDATE all 3 member <CNT>s via /fopt setting lbl -> expects OK on the aggregated request, checks 3 individual UPDATED responses, each verified by a direct RETRIEVE that lbl was applied. |
| 11 | test_addExistingCNTtoGRP |
RETRIEVE the <GRP> -> expects OK; UPDATE mid to add a duplicate of an already-member <CNT> -> expects UPDATED, checks cnm is unchanged (no duplicate counted). |
| 12 | test_deleteCNTviaFOPT |
DELETE all 3 member <CNT>s via /fopt -> expects OK on the aggregated request, checks 3 individual DELETED responses. |
| 13 | test_deleteGRPByUnknownOriginator |
DELETE the <GRP> with an unauthorized originator -> expects ORIGINATOR_HAS_NO_PRIVILEGE. |
| 14 | test_deleteGRPByAssignedOriginator |
DELETE the <GRP> with the correct originator -> expects DELETED. |
| 15 | test_createGRP2 |
Re-create the 2 member <CNT>s; CREATE a new <GRP> with mnm=2 and mid referencing both -> expects CREATED. |
| 16 | test_addTooManyCNTToGRP2 |
CREATE a 3rd <CNT> -> expects CREATED; UPDATE the <GRP> (with mnm=2) to add it as a 3rd member -> expects MAX_NUMBER_OF_MEMBER_EXCEEDED. |
| 17 | test_addDeleteContainerCheckMID |
RETRIEVE the <GRP> -> expects OK, checks cnm=2; CREATE a 4th <CNT> -> expects CREATED; UPDATE the <GRP>'s mid to add it -> expects UPDATED, checks cnm=3; DELETE that <CNT> directly -> expects DELETED; RETRIEVE the <GRP> again -> expects OK, checks cnm reverted to 2 and the deleted CNT's ri no longer in mid. |
| 18 | test_attributesGRP2 |
RETRIEVE the <GRP> -> expects OK; checks attributes (ty, pi, rn, timestamps, mt, mnm=2, cnm=2, mid length 2, st absent) confirming the failed over-limit UPDATE didn't change membership. |
| 19 | test_createGRPWithCreatorWrong |
CREATE a <GRP> with cr explicitly set to a wrong non-null value -> expects BAD_REQUEST. |
| 20 | test_createGRPWithCreator |
CREATE a <GRP> with cr set to None -> expects CREATED, checks cr auto-set to originator; RETRIEVE it -> expects OK, checks cr persists. |
| 21 | test_createCNTviaFopt |
CREATE a <CNT> under each of the group's 2 member <CNT>s via /fopt -> expects OK on the aggregated request, checks 2 individual responses. |
| 22 | test_retrieveCNTviaFopt |
RETRIEVE the just-created nested <CNT> under each member via /fopt/container -> expects OK on the aggregated request, checks 2 individual OK responses with matching rn, ty, and cni=0. |
| 23 | test_createCNTCNTviaFopt |
CREATE another nested <CNT> one level deeper under each member's container via /fopt/container -> expects OK on the aggregated request, checks 2 individual responses. |
testACTR.py — Action (<ACTR>) resource lifecycle, subject/action/dependency evaluation, and triggering (39 tests)
| # | Test Method | Requests Performed |
|---|---|---|
| 1 | test_createACTRWrongORCFail |
CREATE an <ACTR> under the <AE> with orc (originator's resource) set to an invalid value ('todo') -> expects BAD_REQUEST. |
| 2 | test_createACTRNoAccessORCFail |
CREATE an <ACTR> with orc pointing to a <CNT> the originator has no access to -> expects BAD_REQUEST. |
| 3 | test_createACTRNoAccessSRIFail |
CREATE an <ACTR> with sri (subject resource) pointing to a <CNT> with no access, while orc is valid -> expects BAD_REQUEST. |
| 4 | test_createACTRWrongEVCAttributeFail |
CREATE an <ACTR> with an unknown attribute inside evc -> expects BAD_REQUEST. |
| 5 | test_createACTRInvalidAPVFail |
CREATE an <ACTR> with an empty apv (action to be performed) -> expects BAD_REQUEST. |
| 6 | test_createACTRInvalidFromFail |
CREATE an <ACTR> with apv.fr set to an invalid originator -> expects BAD_REQUEST. |
| 7 | test_createACTRInvalidEVMRangeFail |
CREATE an <ACTR> with evm set to an out-of-range value (99) -> expects BAD_REQUEST. |
| 8 | test_createACTRInvalidEVMandECP1Fail |
CREATE an <ACTR> with evm=off together with ecp (evaluation check period, invalid for that mode) -> expects BAD_REQUEST. |
| 9 | test_createACTRInvalidEVMandECP2Fail |
CREATE an <ACTR> with evm=once together with ecp (invalid for that mode) -> expects BAD_REQUEST. |
| 10 | test_createACTRwithInvalidSBJTFail |
CREATE an <ACTR> with evc.sbjt set to an unknown subject attribute -> expects BAD_REQUEST. |
| 11 | test_createACTRwithInvalidTHLDFail |
CREATE an <ACTR> with evc.thld set to a negative number where a non-negative integer is required -> expects BAD_REQUEST. |
| 12 | test_createACTRwithInvalidOPTRFail |
CREATE an <ACTR> with evc.optr (operator, lessThan) incompatible with its sbjt/thld (a list) -> expects BAD_REQUEST. |
| 13 | test_createACTRnoSRI |
CREATE a valid <ACTR> with no sri -> expects CREATED; checks evm, evc, orc, apv.op/fr/to/rqi all match what was specified. |
| 14 | test_createACTRwithSRI |
CREATE a valid <ACTR> with sri set -> expects CREATED; checks all the same attributes plus sri. |
| 15 | test_createACTRwithSRIOnce |
CREATE a valid <ACTR> with sri and evm=once -> expects CREATED; checks all attributes. |
| 16 | test_createACTRwithSRIPeriodic |
CREATE a valid <ACTR> with sri, evm=periodic, and ecp -> expects CREATED; checks all attributes including ecp. |
| 17 | test_createACTRwithSRIContinuous |
CREATE a valid <ACTR> with sri, evm=continuous, and ecp -> expects CREATED; checks all attributes. |
| 18 | test_updateACTROnceECPFail |
UPDATE the once-mode <ACTR> setting evm=once together with ecp (invalid combination) -> expects BAD_REQUEST. |
| 19 | test_updateACTRContinuousWithOnceFail |
UPDATE the continuous-mode <ACTR> switching to evm=once -> expects BAD_REQUEST (existing ecp makes the combination invalid). |
| 20 | test_updateACTRonceWrongSRIFail |
UPDATE the once-mode <ACTR> setting sri to a non-existent resource -> expects BAD_REQUEST. |
| 21 | test_updateACTRonceWrongORCFail |
UPDATE the once-mode <ACTR> setting orc to a non-existent resource -> expects BAD_REQUEST. |
| 22 | test_updateACTRonceWrongSBJTFail |
UPDATE the once-mode <ACTR>'s evc.sbjt to an unknown attribute -> expects BAD_REQUEST. |
| 23 | test_updateACTRonceSRIWrongSBJTFail |
UPDATE the once-mode <ACTR> setting both a valid new sri and an invalid evc.sbjt together -> expects BAD_REQUEST. |
| 24 | test_updateACTRonceNewSRIOldWrongSBJTFail |
UPDATE the once-mode <ACTR> setting only a new sri (whose resource type doesn't support the existing evc.sbjt) -> expects BAD_REQUEST. |
| 25 | test_updateACTRonceNewEVCWrongTHLDFail |
UPDATE the once-mode <ACTR>'s evc.thld to a type-mismatched value (cni subject given a string) -> expects BAD_REQUEST. |
| 26 | test_updateACTRonceORCNullFail |
UPDATE the once-mode <ACTR> setting orc=None (removing it, not allowed) -> expects BAD_REQUEST. |
| 27 | test_updateACTRConceWithOnce |
UPDATE the once-mode <ACTR> re-setting evm=once (now valid alone) -> expects UPDATED; checks evm. |
| 28 | test_updateACTRConceWithPeriodic |
UPDATE the <ACTR> setting evm=periodic -> expects UPDATED; checks evm. |
| 29 | test_updateACTRConceWithContinuous |
UPDATE the <ACTR> setting evm=continuous -> expects UPDATED; checks evm. |
| 30 | test_updateACTRConceWithOff |
UPDATE the <ACTR> setting evm=off -> expects UPDATED; checks evm. |
| 31 | test_deleteACTRnoSRI |
DELETE the no-SRI <ACTR> -> expects DELETED. |
| 32 | test_deleteACTRwithSRI |
DELETE the SRI <ACTR> -> expects DELETED. |
| 33 | test_deleteACTRwithSRIOnce |
DELETE the SRI-once <ACTR> -> expects DELETED. |
| 34 | test_deleteACTRwithSRIPeriodic |
DELETE the SRI-periodic <ACTR> -> expects DELETED. |
| 35 | test_deleteACTRwithSRIContinuous |
DELETE the SRI-continuous <ACTR> -> expects DELETED. |
| 36 | test_testACTROnce |
CREATE a <CNT>; CREATE an <ACTR> under it in evm=once mode with sbjt=cni, targeting the <AE> with an UPDATE action (apv) -> each expects CREATED; CREATE a <CIN> (condition not yet met) -> checks no label applied; CREATE a 2nd <CIN> (condition met) -> checks the label IS applied via RETRIEVE; checks the <ACTR>'s air (action invocation result) reflects an UPDATED response with the label payload; DELETE the <CNT> -> expects DELETED. |
| 37 | test_testACTRParentOnce |
Same once-mode scenario but using the parent subject reference (no explicit sri, defaulting to the parent) -> same CREATE/CIN/label-check/cleanup flow as test_testACTROnce. |
| 38 | test_testACTRContinuous |
Same scenario but evm=continuous with ecp=2 and explicit sri -> after the 2nd <CIN> the label is applied and verified via air; the label is removed; a 3rd <CIN> is created and checked that NO label is reapplied (continuous mode fires once per qualifying transition, not every match); DELETE the <CNT> -> expects DELETED. |
| 39 | test_testACTRPeriodic |
Same scenario but evm=periodic with a longer ecp -> CREATE a <CIN> -> checks label applied; remove label; CREATE a 2nd <CIN> within the same period -> checks NO label re-applied; sleep past the next period; CREATE a 3rd <CIN> -> checks the label IS applied again in the new period; DELETE the <CNT> -> expects DELETED. |
testDEPR.py — Dependency (<DEPR>) resource functionality (18 tests)
| # | Test Method | Requests Performed |
|---|---|---|
| 1 | test_createDEPRUnderAE |
CREATE a <DEPR> directly under the <AE> (instead of under an <ACTR>) -> expects INVALID_CHILD_RESOURCE_TYPE. |
| 2 | test_createDEPRWrongRRIFail |
CREATE a <DEPR> under the <ACTR> with rri (referenced resource ID) pointing to a non-existent resource -> expects BAD_REQUEST. |
| 3 | test_createDEPRWrongSBJTFail |
CREATE a <DEPR> with evc.sbjt (evaluation subject attribute) set to an invalid/unknown attribute name -> expects BAD_REQUEST. |
| 4 | test_createDEPRWrongTHLDTypeFail |
CREATE a <DEPR> with evc.thld (threshold) of a type incompatible with the subject attribute (cni, a number, given as a string) -> expects BAD_REQUEST. |
| 5 | test_createDEPR |
CREATE a valid <DEPR> under the <ACTR> with evc (cbs >= 1), sfc=True, and rri pointing to the <CNT> -> expects CREATED; DELETE it -> expects DELETED. |
| 6 | test_updateDEPRWrongTypeFail |
CREATE a <DEPR> -> expects CREATED; attempt to UPDATE the <ACTR> (wrong resource/type) with a m2m:depr body -> expects CONTENTS_UNACCEPTABLE; DELETE the <DEPR> -> expects DELETED. |
| 7 | test_updateDEPRsfc |
CREATE a <DEPR> -> expects CREATED; UPDATE it setting sfc=False -> expects UPDATED; DELETE it -> expects DELETED. |
| 8 | test_updateDEPRrri |
CREATE a <DEPR> -> expects CREATED; UPDATE its rri to point to the 2nd <CNT> -> expects UPDATED; DELETE it -> expects DELETED. |
| 9 | test_updateDEPRevc |
CREATE a <DEPR> with one evc -> expects CREATED; UPDATE evc to a different operator -> expects UPDATED; DELETE it -> expects DELETED. |
| 10 | test_updateACTRdepWrongFail |
UPDATE the <ACTR> setting dep (dependency list) to a non-existent reference -> expects BAD_REQUEST. |
| 11 | test_updateACTRdep |
CREATE a <DEPR> -> expects CREATED; UPDATE the <ACTR> setting dep to reference it -> expects UPDATED, checks dep; DELETE the <DEPR> -> expects DELETED. |
| 12 | test_ACTRDEPRsfcTrue |
Restart the <ACTR>'s periodic evaluation window; CREATE a <DEPR> (sfc=True, condition on cbs) and link it via the <ACTR>'s dep -> expects CREATED/UPDATED; CREATE a <CIN> (satisfying the dependency) -> expects CREATED; after a delay, RETRIEVE the <AE> -> expects OK, checks the action's label-setting effect (lbl) was applied; remove the label; DELETE the <DEPR> -> expects DELETED. |
| 13 | test_ACTRDEPRsfcFalse |
Same as test_ACTRDEPRsfcTrue but with sfc=False on the <DEPR> -> CREATE a <CIN>, checks the action still fires (label applied) since the single dependency is satisfied regardless of sfc; cleanup as before. |
| 14 | test_ACTRDEPRsfcTrueMissingConditionFail |
CREATE a <DEPR> (sfc=True) whose condition is on lbl (not satisfied by the upcoming <CIN> creation) and link it to the <ACTR> -> expects CREATED/UPDATED; CREATE a <CIN> -> expects CREATED; RETRIEVE the <AE> -> expects OK, checks NO label was applied (dependency condition not met); DELETE the <DEPR> -> expects DELETED. |
| 15 | test_ACTRDEPRsfcTrueAddedCondition |
Same setup as the missing-condition test (sfc=True, condition on lbl); after confirming no label is applied initially, UPDATE the <CNT> to add the matching lbl -> expects UPDATED; after a delay, RETRIEVE the <AE> -> expects OK, checks the label was now applied (condition newly satisfied); remove the label and the <CNT>'s label; DELETE the <DEPR> -> expects DELETED. |
| 16 | test_ACTRDEPRsfcFalseAddedCondition |
Same flow as the sfc=True added-condition test but with sfc=False on the <DEPR> -> checks the same entering-condition behavior (no label until the <CNT> label is added, then label applied); cleanup as before. |
| 17 | test_ACTRDEPRsfcFalseTwoDependenciesOneChangeFail |
CREATE 2 <DEPR>s with sfc=False (one condition on lbl, one on cbs) linked to the <ACTR>'s dep -> each expects CREATED/UPDATED; CREATE a <CIN> (satisfies only the cbs condition, not lbl) -> expects CREATED; RETRIEVE the <AE> -> expects OK, checks NO label applied (only one of two sfc=False dependencies met -- still need at least one transitions correctly, but in this scenario neither newly transitions to trigger); DELETE both <DEPR>s -> each expects DELETED. |
| 18 | test_ACTRDEPRsfcFalseTwoDependencies |
Same 2-dependency (sfc=False) setup; CREATE a <CIN> (satisfies the cbs condition) -> expects CREATED, checks NO label yet; UPDATE the <CNT> to add the matching lbl (now satisfies the 2nd condition too) -> expects UPDATED; after a delay, RETRIEVE the <AE> -> expects OK, checks the label was applied; cleanup label and DELETE both <DEPR>s -> each expects DELETED. |