FAQ
| This is a
LIVE
service |
Changelog
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
ews-coordinator
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package registry
Container Registry
Operate
Terraform modules
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
GitLab has been upgraded. See what's new in the
Changelog
.
Show more breadcrumbs
Gilligan Lab for Epidemiology and Modelling
Wheat rusts
ews-coordinator
Commits
7b57f533
Commit
7b57f533
authored
2 years ago
by
L. Bower
Browse files
Options
Downloads
Patches
Plain Diff
updating epi test
parent
df4f1646
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/integration/test_epi.py
+72
-0
72 additions, 0 deletions
tests/integration/test_epi.py
with
72 additions
and
0 deletions
tests/integration/test_epi.py
0 → 100644
+
72
−
0
View file @
7b57f533
import
copy
import
os
import
unittest
from
integration.integration_test_utils
import
IntegrationTestUtils
class
TestEpi
(
unittest
.
TestCase
):
TEST_OUT_PATH
:
str
=
"
not_set
"
TEST_START_DATE
:
str
=
'
20221001
'
TEST_JOB_DIR
:
str
=
"
SUMMARY_
"
+
TEST_START_DATE
@classmethod
def
setUpClass
(
cls
)
->
None
:
TestEpi
.
write_temp_run_config_files
()
TestEpi
.
unpack_dependencies
()
TestEpi
.
run_advisory_pipeline
()
@staticmethod
def
write_temp_run_config_files
():
nowstring
:
str
=
IntegrationTestUtils
.
get_now_string
()
prefix
:
str
=
"
temp_epi_
"
+
nowstring
# prefix: str = ""
default_config
=
IntegrationTestUtils
.
DEFAULT_CONFIG_FILE_PATH
default_config_dict
:
dict
=
IntegrationTestUtils
.
load_json_file
(
default_config
)
run_dict
:
dict
=
copy
.
deepcopy
(
default_config_dict
)
TestEpi
.
TEST_OUT_PATH
=
run_dict
[
'
WorkspacePathout
'
]
+
prefix
+
os
.
sep
run_dict
[
'
WorkspacePathout
'
]
=
TestEpi
.
TEST_OUT_PATH
run_dict
[
'
WorkspacePath
'
]
=
TestEpi
.
TEST_OUT_PATH
run_dict
[
'
ServerName
'
]
=
''
# nothing, as local machine
IntegrationTestUtils
.
write_json_file
(
run_dict
,
IntegrationTestUtils
.
TEMP_CONFIG_FILE_PATH
)
@staticmethod
def
unpack_dependencies
():
IntegrationTestUtils
.
unpack_zip
(
IntegrationTestUtils
.
EXAMPLE_SURVEY_FILE_PATH
,
TestEpi
.
TEST_OUT_PATH
)
IntegrationTestUtils
.
unpack_zip
(
IntegrationTestUtils
.
EXAMPLE_DEPO_FILE_PATH
,
TestEpi
.
TEST_OUT_PATH
)
IntegrationTestUtils
.
unpack_zip
(
IntegrationTestUtils
.
EXAMPLE_ENV_SUIT_FILE_PATH
,
TestEpi
.
TEST_OUT_PATH
)
@staticmethod
def
run_advisory_pipeline
():
component
=
'
Epidemiology
'
IntegrationTestUtils
.
run_pipeline
(
component
,
TestEpi
.
TEST_START_DATE
)
def
test_standard_run_input_status_success
(
self
):
status_file_path
=
os
.
path
.
join
(
TestEpi
.
TEST_OUT_PATH
,
TestEpi
.
TEST_JOB_DIR
,
"
STATUS_SUCCESS
"
)
success_file_exists
:
bool
=
os
.
path
.
isfile
(
status_file_path
)
self
.
assertTrue
(
success_file_exists
)
def
test_standard_run_input_all_docs_produced
(
self
):
east_africa_image_path
=
os
.
path
.
join
(
TestEpi
.
TEST_OUT_PATH
,
TestEpi
.
TEST_JOB_DIR
,
"
tight-layout
"
,
"
wheat_rust_advisory_template_EastAfrica_20221001.docx
"
)
ethiopia_image_path
=
os
.
path
.
join
(
TestEpi
.
TEST_OUT_PATH
,
TestEpi
.
TEST_JOB_DIR
,
"
tight-layout
"
,
"
wheat_rust_advisory_template_Ethiopia_20221001.docx
"
)
ea_file_exists
:
bool
=
os
.
path
.
isfile
(
east_africa_image_path
)
eth_file_exists
:
bool
=
os
.
path
.
isfile
(
ethiopia_image_path
)
self
.
assertTrue
(
ea_file_exists
)
self
.
assertTrue
(
eth_file_exists
)
if
__name__
==
'
__main__
'
:
unittest
.
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