Skip to content

Commit

Permalink
updated api tests wrt backwards compat on null chars in IDs
Browse files Browse the repository at this point in the history
  • Loading branch information
cgbaker committed Oct 5, 2020
1 parent 39c73f1 commit 5062e74
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions api/jobs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1291,7 +1291,7 @@ func TestJobs_Info(t *testing.T) {

// Trying to retrieve a job by ID before it exists
// returns an error
id := "job-id/with\\troublesome:characters\n?&字\000"
id := "job-id/with\\troublesome:characters\n?&字"
_, _, err := jobs.Info(id, nil)
if err == nil || !strings.Contains(err.Error(), "not found") {
t.Fatalf("expected not found error, got: %#v", err)
Expand Down Expand Up @@ -1993,7 +1993,7 @@ func TestJobs_ScaleAction(t *testing.T) {
defer s.Stop()
jobs := c.Jobs()

id := "job-id/with\\troublesome:characters\n?&字\000"
id := "job-id/with\\troublesome:characters\n?&字"
job := testJobWithScalingPolicy()
job.ID = &id
groupName := *job.TaskGroups[0].Name
Expand Down Expand Up @@ -2054,7 +2054,7 @@ func TestJobs_ScaleAction_Error(t *testing.T) {
defer s.Stop()
jobs := c.Jobs()

id := "job-id/with\\troublesome:characters\n?&字\000"
id := "job-id/with\\troublesome:characters\n?&字"
job := testJobWithScalingPolicy()
job.ID = &id
groupName := *job.TaskGroups[0].Name
Expand Down Expand Up @@ -2106,7 +2106,7 @@ func TestJobs_ScaleAction_Noop(t *testing.T) {
defer s.Stop()
jobs := c.Jobs()

id := "job-id/with\\troublesome:characters\n?&字\000"
id := "job-id/with\\troublesome:characters\n?&字"
job := testJobWithScalingPolicy()
job.ID = &id
groupName := *job.TaskGroups[0].Name
Expand Down Expand Up @@ -2161,7 +2161,7 @@ func TestJobs_ScaleStatus(t *testing.T) {
jobs := c.Jobs()

// Trying to retrieve a status before it exists returns an error
id := "job-id/with\\troublesome:characters\n?&字\000"
id := "job-id/with\\troublesome:characters\n?&字"
_, _, err := jobs.ScaleStatus(id, nil)
require.Error(err)
require.Contains(err.Error(), "not found")
Expand Down

0 comments on commit 5062e74

Please sign in to comment.