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
Sebastian Bindgen
pystencils
Commits
501334ba
Commit
501334ba
authored
Aug 09, 2020
by
Markus Holzer
Browse files
Use absolute instead of relative path in datahandling test case
parent
a638163a
Changes
1
Hide whitespace changes
Inline
Side-by-side
pystencils_tests/test_datahandling.py
View file @
501334ba
...
...
@@ -13,7 +13,7 @@ except ImportError:
import
unittest.mock
pytest
=
unittest
.
mock
.
MagicMock
()
SCRIPT_FOLDER
=
Path
(
__file__
).
parent
SCRIPT_FOLDER
=
Path
(
__file__
).
parent
.
absolute
()
INPUT_FOLDER
=
SCRIPT_FOLDER
/
"test_data"
...
...
@@ -325,7 +325,7 @@ def test_save_data():
dh
.
add_array
(
"dst"
,
values_per_cell
=
9
)
dh
.
fill
(
"dst"
,
1.0
,
ghost_layers
=
True
)
dh
.
save_all
(
INPUT_FOLDER
.
name
+
'/datahandling_save_test'
)
dh
.
save_all
(
str
(
INPUT_FOLDER
)
+
'/datahandling_save_test'
)
def
test_load_data
():
...
...
@@ -337,7 +337,7 @@ def test_load_data():
dh
.
add_array
(
"dst"
,
values_per_cell
=
9
)
dh
.
fill
(
"dst"
,
0.0
,
ghost_layers
=
True
)
dh
.
load_all
(
INPUT_FOLDER
.
name
+
'/datahandling_load_test'
)
dh
.
load_all
(
str
(
INPUT_FOLDER
)
+
'/datahandling_load_test'
)
assert
np
.
all
(
dh
.
cpu_arrays
[
'src'
])
==
1
assert
np
.
all
(
dh
.
cpu_arrays
[
'dst'
])
==
1
...
...
@@ -351,7 +351,7 @@ def test_load_data():
dh
.
add_array
(
"dst2"
,
values_per_cell
=
9
)
dh
.
fill
(
"dst2"
,
0.0
,
ghost_layers
=
True
)
dh
.
load_all
(
INPUT_FOLDER
.
name
+
'/datahandling_load_test'
)
dh
.
load_all
(
str
(
INPUT_FOLDER
)
+
'/datahandling_load_test'
)
assert
np
.
all
(
dh
.
cpu_arrays
[
'src'
])
==
0
assert
np
.
all
(
dh
.
cpu_arrays
[
'dst'
])
==
0
assert
np
.
all
(
dh
.
cpu_arrays
[
'dst2'
])
==
0
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