From 23313c2efe0c97cb8935e6cc5185f4c679bdc5bd Mon Sep 17 00:00:00 2001 From: Alexander Hellbom Date: Tue, 27 Jun 2017 00:45:47 +0200 Subject: [PATCH] Simplify vendor test --- tests/integration/vendor_test.go | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/tests/integration/vendor_test.go b/tests/integration/vendor_test.go index b15f840f..acc6cdad 100644 --- a/tests/integration/vendor_test.go +++ b/tests/integration/vendor_test.go @@ -9,25 +9,12 @@ import ( func TestVendorsList(t *testing.T) { setup(t) - var offset int - var vendors []*pagerduty.Vendor - - for { - resp, _, err := client.Vendors.List(&pagerduty.ListVendorsOptions{Pagination: &pagerduty.Pagination{Offset: offset}}) - if err != nil { - t.Fatal(err) - } - - vendors = append(vendors, resp.Vendors...) - - if !resp.More { - break - } - - offset += 25 + resp, _, err := client.Vendors.List(&pagerduty.ListVendorsOptions{}) + if err != nil { + t.Fatal(err) } - if len(vendors) == 0 { + if len(resp.Vendors) == 0 { t.Fatal("expected at least one vendor to be found") } }