Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Nomad
Commits
73375f5c
Commit
73375f5c
authored
7 years ago
by
Alex Dadgar
Browse files
Options
Download
Email Patches
Plain Diff
fix api job tests
parent
78b2c638
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
api/jobs_test.go
+4
-16
api/jobs_test.go
with
4 additions
and
16 deletions
+4
-16
api/jobs_test.go
+
4
-
16
View file @
73375f5c
...
...
@@ -25,9 +25,6 @@ func TestJobs_Register(t *testing.T) {
if
err
!=
nil
{
t
.
Fatalf
(
"err: %s"
,
err
)
}
if
qm
.
LastIndex
!=
0
{
t
.
Fatalf
(
"bad index: %d"
,
qm
.
LastIndex
)
}
if
n
:=
len
(
resp
);
n
!=
0
{
t
.
Fatalf
(
"expected 0 jobs, got: %d"
,
n
)
}
...
...
@@ -653,9 +650,6 @@ func TestJobs_EnforceRegister(t *testing.T) {
if
err
!=
nil
{
t
.
Fatalf
(
"err: %s"
,
err
)
}
if
qm
.
LastIndex
!=
0
{
t
.
Fatalf
(
"bad index: %d"
,
qm
.
LastIndex
)
}
if
n
:=
len
(
resp
);
n
!=
0
{
t
.
Fatalf
(
"expected 0 jobs, got: %d"
,
n
)
}
...
...
@@ -835,13 +829,10 @@ func TestJobs_PrefixList(t *testing.T) {
jobs
:=
c
.
Jobs
()
// Listing when nothing exists returns empty
results
,
qm
,
err
:=
jobs
.
PrefixList
(
"dummy"
)
results
,
_
,
err
:=
jobs
.
PrefixList
(
"dummy"
)
if
err
!=
nil
{
t
.
Fatalf
(
"err: %s"
,
err
)
}
if
qm
.
LastIndex
!=
0
{
t
.
Fatalf
(
"bad index: %d"
,
qm
.
LastIndex
)
}
if
n
:=
len
(
results
);
n
!=
0
{
t
.
Fatalf
(
"expected 0 jobs, got: %d"
,
n
)
}
...
...
@@ -856,7 +847,7 @@ func TestJobs_PrefixList(t *testing.T) {
// Query the job again and ensure it exists
// Listing when nothing exists returns empty
results
,
qm
,
err
=
jobs
.
PrefixList
((
*
job
.
ID
)[
:
1
])
results
,
_
,
err
=
jobs
.
PrefixList
((
*
job
.
ID
)[
:
1
])
if
err
!=
nil
{
t
.
Fatalf
(
"err: %s"
,
err
)
}
...
...
@@ -874,13 +865,10 @@ func TestJobs_List(t *testing.T) {
jobs
:=
c
.
Jobs
()
// Listing when nothing exists returns empty
results
,
qm
,
err
:=
jobs
.
List
(
nil
)
results
,
_
,
err
:=
jobs
.
List
(
nil
)
if
err
!=
nil
{
t
.
Fatalf
(
"err: %s"
,
err
)
}
if
qm
.
LastIndex
!=
0
{
t
.
Fatalf
(
"bad index: %d"
,
qm
.
LastIndex
)
}
if
n
:=
len
(
results
);
n
!=
0
{
t
.
Fatalf
(
"expected 0 jobs, got: %d"
,
n
)
}
...
...
@@ -895,7 +883,7 @@ func TestJobs_List(t *testing.T) {
// Query the job again and ensure it exists
// Listing when nothing exists returns empty
results
,
qm
,
err
=
jobs
.
List
(
nil
)
results
,
_
,
err
=
jobs
.
List
(
nil
)
if
err
!=
nil
{
t
.
Fatalf
(
"err: %s"
,
err
)
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help