From 46421dd8bd3031a9d56bd286fb95a6e741865eb1 Mon Sep 17 00:00:00 2001
From: Dave Cameron <dcameron@digitalocean.com>
Date: Wed, 14 Jun 2017 17:17:57 -0400
Subject: [PATCH] tweaks on the Tenancy implementation

- some typos
- the generate comments need to be consistent to avoid dirty git files
  after each go generate
- the comparisons in the tests already include the TenantGroup, so
  separate assertions are not needed
---
 netbox/tenancy.go                          |  2 +-
 netbox/tenancy_tenant-groups_basic_test.go |  2 +-
 netbox/tenancy_tenants_basic_test.go       |  2 +-
 netbox/tenancy_tenants_test.go             | 18 ++++++------------
 netbox/tenancy_tenants_types.go            |  2 +-
 5 files changed, 10 insertions(+), 16 deletions(-)

diff --git a/netbox/tenancy.go b/netbox/tenancy.go
index b44124f..fb5b3e9 100644
--- a/netbox/tenancy.go
+++ b/netbox/tenancy.go
@@ -14,7 +14,7 @@
 
 package netbox
 
-// A TenancyService is udes in a Client to access NetBox's Tenancy API methods.
+// A TenancyService is used in a Client to access NetBox's Tenancy API methods.
 type TenancyService struct {
 	c            *Client
 	TenantGroups *TenantGroupsService
diff --git a/netbox/tenancy_tenant-groups_basic_test.go b/netbox/tenancy_tenant-groups_basic_test.go
index 2e3322e..3af2124 100644
--- a/netbox/tenancy_tenant-groups_basic_test.go
+++ b/netbox/tenancy_tenant-groups_basic_test.go
@@ -12,7 +12,7 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-// Code generated by generate_functions.go. DO NOT EDIT.
+// Code generated by generate_basic_tests.go. DO NOT EDIT.
 
 package netbox
 
diff --git a/netbox/tenancy_tenants_basic_test.go b/netbox/tenancy_tenants_basic_test.go
index e26756f..6e87fd6 100644
--- a/netbox/tenancy_tenants_basic_test.go
+++ b/netbox/tenancy_tenants_basic_test.go
@@ -12,7 +12,7 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-// Code generated by generate_functions.go. DO NOT EDIT.
+// Code generated by generate_basic_tests.go. DO NOT EDIT.
 
 package netbox
 
diff --git a/netbox/tenancy_tenants_test.go b/netbox/tenancy_tenants_test.go
index b46f9ea..5e74b31 100644
--- a/netbox/tenancy_tenants_test.go
+++ b/netbox/tenancy_tenants_test.go
@@ -26,19 +26,16 @@ import (
 
 func TestTenantGet(t *testing.T) {
 	var tests = []struct {
-		desc      string
-		want      *Tenant
-		wantGroup *TenantGroup
+		desc string
+		want *Tenant
 	}{
 		{
-			desc:      "Without TenantGroup",
-			want:      testTenantWithGroup(1, nil),
-			wantGroup: nil,
+			desc: "Without TenantGroup",
+			want: testTenantWithGroup(1, nil),
 		},
 		{
-			desc:      "With TenantGroup",
-			want:      testTenantWithGroup(1, testTenantGroup(1)),
-			wantGroup: testTenantGroup(1),
+			desc: "With TenantGroup",
+			want: testTenantWithGroup(1, testTenantGroup(1)),
 		},
 	}
 
@@ -57,9 +54,6 @@ func TestTenantGet(t *testing.T) {
 			if want, got := tt.want, res; !reflect.DeepEqual(want, got) {
 				t.Fatalf("unexpected Tenant:\n- want: %v\n-  got: %v", want, got)
 			}
-			if want, got := tt.wantGroup, res.Group; !reflect.DeepEqual(want, got) {
-				t.Fatalf("unexpected TenantGroup:\n- want: %v\n-  got: %v", want, got)
-			}
 		})
 	}
 }
diff --git a/netbox/tenancy_tenants_types.go b/netbox/tenancy_tenants_types.go
index ea64d3d..75fbfd0 100644
--- a/netbox/tenancy_tenants_types.go
+++ b/netbox/tenancy_tenants_types.go
@@ -57,7 +57,7 @@ func (t *Tenant) MarshalJSON() ([]byte, error) {
 	})
 }
 
-// ListTenantOptions is used as an argument for Client.Tenancy.Tenant.List.
+// ListTenantOptions is used as an argument for Client.Tenancy.Tenants.List.
 // Integer fields with an *ID suffix are preferred over their string
 // counterparts, and if both are set, only the *ID field will be used.
 type ListTenantOptions struct {
-- 
GitLab