Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
LOFAR
Manage
Activity
Members
Labels
Plan
Issues
Wiki
Jira issues
Open Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Insights
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
RadioObservatory
LOFAR
Commits
7c7cdb6b
Commit
7c7cdb6b
authored
6 years ago
by
Auke Klazema
Browse files
Options
Downloads
Patches
Plain Diff
SW-609
: Create JSON with a String instead of Bytes
parent
c99525e4
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
LTA/ltastorageoverview/test/test_lso_webservice.py
+4
-4
4 additions, 4 deletions
LTA/ltastorageoverview/test/test_lso_webservice.py
SAS/SpecificationServices/test/t_telescope_model_xml_generator_type1.py
+2
-2
2 additions, 2 deletions
...ionServices/test/t_telescope_model_xml_generator_type1.py
with
6 additions
and
6 deletions
LTA/ltastorageoverview/test/test_lso_webservice.py
+
4
−
4
View file @
7c7cdb6b
...
...
@@ -29,7 +29,7 @@ import urllib.request, urllib.error, urllib.parse
import
json
import
datetime
import
psycopg2
from
io
import
Bytes
IO
from
io
import
String
IO
import
lofar.common.dbcredentials
as
dbc
from
lofar.lta.ltastorageoverview
import
store
from
lofar.lta.ltastorageoverview.webservice
import
webservice
as
webservice
...
...
@@ -116,7 +116,7 @@ class TestLTAStorageWebService(FlaskLiveTestCase):
self
.
assertEqual
(
200
,
response
.
code
)
self
.
assertEqual
(
'
application/json
'
,
response
.
info
()[
'
Content-Type
'
])
content
=
json
.
load
(
Bytes
IO
(
response
.
read
()))
content
=
json
.
load
(
String
IO
(
response
.
read
()
.
decode
(
"
UTF-8
"
)
))
self
.
assertTrue
(
'
sites
'
in
content
)
sites
=
content
[
'
sites
'
]
...
...
@@ -132,7 +132,7 @@ class TestLTAStorageWebService(FlaskLiveTestCase):
self
.
assertEqual
(
200
,
response
.
code
)
self
.
assertEqual
(
'
application/json
'
,
response
.
info
()[
'
Content-Type
'
])
content
=
json
.
load
(
Bytes
IO
(
response
.
read
()))
content
=
json
.
load
(
String
IO
(
response
.
read
()
.
decode
(
"
UTF-8
"
)
))
self
.
assertTrue
(
'
id
'
in
content
)
self
.
assertTrue
(
'
name
'
in
content
)
...
...
@@ -143,7 +143,7 @@ class TestLTAStorageWebService(FlaskLiveTestCase):
self
.
assertEqual
(
200
,
response
.
code
)
self
.
assertEqual
(
'
application/json
'
,
response
.
info
()[
'
Content-Type
'
])
content
=
json
.
load
(
Bytes
IO
(
response
.
read
()))
content
=
json
.
load
(
String
IO
(
response
.
read
()
.
decode
(
"
UTF-8
"
)
))
self
.
assertTrue
(
'
rootDirectories
'
in
content
)
rootDirectories
=
content
[
'
rootDirectories
'
]
...
...
This diff is collapsed.
Click to expand it.
SAS/SpecificationServices/test/t_telescope_model_xml_generator_type1.py
+
2
−
2
View file @
7c7cdb6b
...
...
@@ -84,7 +84,7 @@ class TestTelescopeModelXMLGeneratorType1(unittest.TestCase):
generator
=
TelescopeModelXMLGeneratorType1
()
xmldoc
=
generator
.
get_xml_tree
(
self
.
model
)
result
=
etree
.
tostring
(
xmldoc
)
result
=
str
(
etree
.
tostring
(
xmldoc
)
,
"
UTF-8
"
)
assertEqualXML
(
result
,
golden_xmldoc
)
...
...
@@ -94,7 +94,7 @@ class TestTelescopeModelXMLGeneratorType1(unittest.TestCase):
f
.
close
()
xmldoc
=
etree
.
parse
(
BytesIO
(
xmlcontent
.
encode
(
'
UTF-8
'
)))
return
etree
.
tostring
(
xmldoc
)
return
str
(
etree
.
tostring
(
xmldoc
)
,
"
UTF-8
"
)
if
__name__
==
'
__main__
'
:
...
...
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