Skip to content
Snippets Groups Projects
Commit 46421dd8 authored by Dave Cameron's avatar Dave Cameron
Browse files

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
parent 2140d310
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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)
}
})
}
}
......
......@@ -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 {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment