Skip to content

Commit

Permalink
fixup! CP-52320 & CP-52795: Add unit tests for tgroup library
Browse files Browse the repository at this point in the history
  • Loading branch information
GabrielBuica committed Jan 7, 2025
1 parent d931ec4 commit cb06b56
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions ocaml/libs/tgroup/test_tgroup.ml
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,34 @@ let test_of_creator () =
[
((None, None, None, None), "external/unauthenticated")
; ((Some true, None, None, None), "external/intrapool")
; ( (Some true, Some "external", Some dummy_identity, Some "sm")
; ( ( Some true
, Some Tgroup.Group.Endpoint.External
, Some dummy_identity
, Some "sm"
)
, "external/intrapool"
)
; ( (Some true, Some "internal", Some dummy_identity, Some "sm")
; ( ( Some true
, Some Tgroup.Group.Endpoint.Internal
, Some dummy_identity
, Some "sm"
)
, "external/intrapool"
)
; ((None, Some "intenal", Some dummy_identity, Some "cli"), "internal/cli")
; ( ( None
, Some Tgroup.Group.Endpoint.Internal
, Some dummy_identity
, Some "cli"
)
, "internal/cli"
)
; ( (None, None, Some dummy_identity, Some "sm")
, "external/authenticated/root/XenCenter2024"
)
]
in
let test_make ((intrapool, endpoint, identity, originator), expected_group) =
let originator = Option.map Tgroup.Group.Originator.of_string originator in
let actual_group =
Tgroup.Group.(
Creator.make ?intrapool ?endpoint ?identity ?originator ()
Expand Down

0 comments on commit cb06b56

Please sign in to comment.