Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
beat
beat.core
Commits
9a853f39
Commit
9a853f39
authored
Mar 20, 2019
by
Samuel GAIST
Browse files
[test][worker] Import simplejson as json to make it easy to swap
parent
e56b22e3
Changes
1
Hide whitespace changes
Inline
Side-by-side
beat/core/test/test_worker.py
View file @
9a853f39
...
...
@@ -39,7 +39,7 @@
import
os
import
logging
import
unittest
import
simplejson
import
simplejson
as
json
import
multiprocessing
import
queue
...
...
@@ -394,7 +394,7 @@ class TestOneWorker(TestWorkerBase):
self
.
assertEqual
(
status
,
WorkerController
.
DONE
)
self
.
assertEqual
(
job_id
,
expected_job_id
)
result
=
simple
json
.
loads
(
data
[
0
])
result
=
json
.
loads
(
data
[
0
])
self
.
assertEqual
(
result
[
"status"
],
0
)
...
...
@@ -419,7 +419,7 @@ class TestOneWorker(TestWorkerBase):
self
.
assertEqual
(
status
,
WorkerController
.
JOB_ERROR
)
self
.
assertEqual
(
job_id
,
1
)
result
=
simple
json
.
loads
(
data
[
0
])
result
=
json
.
loads
(
data
[
0
])
self
.
assertEqual
(
result
[
"status"
],
1
)
self
.
assertTrue
(
"a = b"
in
result
[
"user_error"
])
...
...
@@ -534,7 +534,7 @@ class TestTwoWorkers(TestWorkerBase):
self
.
assertEqual
(
status
,
WorkerController
.
DONE
)
self
.
assertEqual
(
job_id
,
1
)
result
=
simple
json
.
loads
(
data
[
0
])
result
=
json
.
loads
(
data
[
0
])
self
.
assertEqual
(
result
[
"status"
],
0
)
...
...
@@ -554,7 +554,7 @@ class TestTwoWorkers(TestWorkerBase):
self
.
assertEqual
(
worker
,
WORKER2
)
self
.
assertEqual
(
job_id
,
2
)
result
=
simple
json
.
loads
(
data
[
0
])
result
=
json
.
loads
(
data
[
0
])
self
.
assertEqual
(
result
[
"status"
],
0
)
self
.
controller
.
execute
(
WORKER1
,
1
,
CONFIGURATION1
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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