github.com/vnpaycloud-console/gophercloud/v2@v2.0.5/openstack/baremetalintrospection/v1/introspection/testing/results_test.go (about) 1 package testing 2 3 import ( 4 "encoding/json" 5 "testing" 6 7 "github.com/vnpaycloud-console/gophercloud/v2/openstack/baremetalintrospection/v1/introspection" 8 th "github.com/vnpaycloud-console/gophercloud/v2/testhelper" 9 ) 10 11 func TestHostnameInInventory(t *testing.T) { 12 var output introspection.Data 13 err := json.Unmarshal([]byte(IntrospectionDataJSONSample), &output) 14 if err != nil { 15 t.Fatalf("Failed to unmarshal Inventory data: %s", err) 16 } 17 18 th.CheckDeepEquals(t, IntrospectionDataRes.Inventory.Hostname, "myawesomehost") 19 }