Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
beat.core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
beat
beat.core
Commits
9a853f39
Commit
9a853f39
authored
6 years ago
by
Samuel GAIST
Browse files
Options
Downloads
Patches
Plain Diff
[test][worker] Import simplejson as json to make it easy to swap
parent
e56b22e3
No related branches found
No related tags found
1 merge request
!64
Factorize simplejson
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
beat/core/test/test_worker.py
+5
-5
5 additions, 5 deletions
beat/core/test/test_worker.py
with
5 additions
and
5 deletions
beat/core/test/test_worker.py
+
5
−
5
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
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment