github.com/chnsz/golangsdk@v0.0.0-20240506093406-85a3fbfa605b/openstack/dli/v2/spark/resources/testing/requests_test.go (about) 1 package testing 2 3 import ( 4 "testing" 5 6 "github.com/chnsz/golangsdk/openstack/dli/v2/spark/resources" 7 th "github.com/chnsz/golangsdk/testhelper" 8 "github.com/chnsz/golangsdk/testhelper/client" 9 ) 10 11 func TestV2CreateGroupAndUploadPackage(t *testing.T) { 12 th.SetupHTTP() 13 defer th.TeardownHTTP() 14 handleV2CreateGroupAndUploadPackage(t) 15 16 actual, err := resources.CreateGroupAndUpload(client.ServiceClient(), createGroupAndUploadOpts) 17 th.AssertNoErr(t, err) 18 th.AssertDeepEquals(t, expectedCreateGroupAndUploadResponseData, actual) 19 } 20 21 func TestV2UploadPackage(t *testing.T) { 22 th.SetupHTTP() 23 defer th.TeardownHTTP() 24 handleV2UploadPackage(t) 25 26 actual, err := resources.Upload(client.ServiceClient(), "pyfiles", uploadOpts) 27 th.AssertNoErr(t, err) 28 th.AssertDeepEquals(t, expectedUploadResponseData, actual) 29 }