MCPcopy Create free account
hub / github.com/devopsctl/gitlabctl / TestGetUsers

Function TestGetUsers

cmd/get_users_test.go:30–104  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

28)
29
30func TestGetUsers(t *testing.T) {
31 tt := []struct {
32 name string
33 flagsMap map[string]string
34 expect testResult
35 }{
36 {
37 name: "lookup by username and print in yaml",
38 flagsMap: map[string]string{
39 "username": "frank.watson",
40 "out": "yaml",
41 },
42 expect: pass,
43 },
44 {
45 name: "lookup by search and print in json",
46 flagsMap: map[string]string{
47 "search": "paul",
48 "out": "json",
49 },
50 expect: pass,
51 },
52 {
53 name: "lookup by active users",
54 flagsMap: map[string]string{
55 "active": "true",
56 },
57 expect: pass,
58 },
59 {
60 name: "lookup by blocked users",
61 flagsMap: map[string]string{
62 "active": "false",
63 "blocked": "true",
64 },
65 expect: pass,
66 },
67 {
68 name: "lookup by create dates",
69 flagsMap: map[string]string{
70 "created-after": "2018",
71 "created-before": "2019-05-31",
72 },
73 expect: pass,
74 },
75 {
76 name: "invalid order-by flag value should fail",
77 flagsMap: map[string]string{
78 "order-by": "xxx",
79 },
80 expect: fail,
81 },
82 {
83 name: "invalid sort flag value should fail",
84 flagsMap: map[string]string{
85 "sort": "xxx",
86 },
87 expect: fail,

Callers

nothing calls this directly

Calls 2

executeCommandMethod · 0.95
printFlagsTableFunction · 0.85

Tested by

no test coverage detected