(t *testing.T)
| 262 | } |
| 263 | |
| 264 | func TestUserCheckApply_AbsentAlready(t *testing.T) { |
| 265 | f := &fakeUserFuncs{} |
| 266 | f.install(t) |
| 267 | |
| 268 | res := &UserRes{State: "absent"} |
| 269 | res.SetName("ghost") |
| 270 | res.SetKind("user") |
| 271 | if err := res.Init(fakeUserInit(t)); err != nil { |
| 272 | t.Fatal(err) |
| 273 | } |
| 274 | |
| 275 | checkOK, err := res.CheckApply(context.Background(), true) |
| 276 | if err != nil { |
| 277 | t.Fatalf("func CheckApply: %v", err) |
| 278 | } |
| 279 | if !checkOK { |
| 280 | t.Errorf("expected checkOK=true for already-absent user") |
| 281 | } |
| 282 | if len(f.cmds) != 0 { |
| 283 | t.Errorf("expected no commands, got %v", f.cmds) |
| 284 | } |
| 285 | } |
| 286 | |
| 287 | func TestUserCheckApply_CreateNoApply(t *testing.T) { |
| 288 | f := &fakeUserFuncs{} |
nothing calls this directly
no test coverage detected