(t *testing.T)
| 499 | } |
| 500 | |
| 501 | func TestDelete(t *testing.T) { |
| 502 | const ( |
| 503 | mockType1 = "MockType1" |
| 504 | mockType2 = "MockType2" |
| 505 | ) |
| 506 | |
| 507 | tests := []struct { |
| 508 | name string |
| 509 | setter *mockSetter |
| 510 | conditionType string |
| 511 | wantConditions []metav1.Condition |
| 512 | }{ |
| 513 | { |
| 514 | name: "nil setter", |
| 515 | setter: nil, |
| 516 | conditionType: mockType1, |
| 517 | wantConditions: nil, |
| 518 | }, |
| 519 | { |
| 520 | name: "empty condition type", |
| 521 | setter: &mockSetter{ |
| 522 | conditions: []metav1.Condition{ |
| 523 | {Type: mockType1, Status: metav1.ConditionTrue}, |
| 524 | }, |
| 525 | }, |
| 526 | conditionType: "", |
| 527 | wantConditions: []metav1.Condition{ |
| 528 | {Type: mockType1, Status: metav1.ConditionTrue}, |
| 529 | }, |
| 530 | }, |
| 531 | { |
| 532 | name: "empty conditions", |
| 533 | setter: &mockSetter{ |
| 534 | conditions: []metav1.Condition{}, |
| 535 | }, |
| 536 | conditionType: mockType1, |
| 537 | wantConditions: []metav1.Condition{}, |
| 538 | }, |
| 539 | { |
| 540 | name: "condition found and deleted", |
| 541 | setter: &mockSetter{ |
| 542 | conditions: []metav1.Condition{ |
| 543 | {Type: mockType1, Status: metav1.ConditionTrue}, |
| 544 | }, |
| 545 | }, |
| 546 | conditionType: mockType1, |
| 547 | wantConditions: []metav1.Condition{}, |
| 548 | }, |
| 549 | { |
| 550 | name: "condition not found", |
| 551 | setter: &mockSetter{ |
| 552 | conditions: []metav1.Condition{ |
| 553 | {Type: mockType1, Status: metav1.ConditionTrue}, |
| 554 | }, |
| 555 | }, |
| 556 | conditionType: mockType2, |
| 557 | wantConditions: []metav1.Condition{ |
| 558 | {Type: mockType1, Status: metav1.ConditionTrue}, |
nothing calls this directly
no test coverage detected