Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Andrew Buddenberg
gcis-py-client
Commits
cd1f2d30
Commit
cd1f2d30
authored
Mar 18, 2014
by
abuddenberg
Browse files
Updated test suite to check for incorrect merge behavior
parent
6915308f
Changes
1
Show whitespace changes
Inline
Side-by-side
src/test_suite.py
View file @
cd1f2d30
...
...
@@ -37,7 +37,7 @@ def test_domain_as_json():
assert
f
.
original
[
'images'
]
not
in
(
None
,
''
)
assert
f
.
original
[
'uri'
]
not
in
(
None
,
''
)
#Make sure
d
fields specifically
#Make sure fields specifically
omitted are actually omitted
fig_json_out
=
json
.
loads
(
f
.
as_json
())
assert
all
([
omitted_key
not
in
fig_json_out
for
omitted_key
in
[
'chapter'
,
'images'
,
'uri'
,
'href'
]])
...
...
@@ -49,6 +49,17 @@ def test_domain_as_json():
img_json_out
=
json
.
loads
(
i
.
as_json
())
assert
all
([
omitted_key
not
in
img_json_out
for
omitted_key
in
[
'uri'
,
'href'
]])
#Make sure merges work
f2_json
=
json
.
loads
(
test_figure_json
)
f2_json
[
'caption'
]
=
''
f2
=
Figure
(
f2_json
)
assert
f2
.
caption
in
(
''
,
None
)
f2
.
merge
(
f
)
assert
f2
.
caption
==
f
.
caption
def
test_chapter_parsing
():
webform_fig
=
Figure
(
json
.
loads
(
webform_json_precip
))
...
...
@@ -94,4 +105,4 @@ def test_dataset_special_properties():
if
__name__
==
'__main__'
:
test_chapter_parsing
()
\ No newline at end of file
test_domain_as_json
()
\ No newline at end of file
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