-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Template tests #163
base: dev
Are you sure you want to change the base?
Template tests #163
Conversation
Codecov Report
@@ Coverage Diff @@
## dev #163 +/- ##
==========================================
+ Coverage 43.67% 52.01% +8.33%
==========================================
Files 64 70 +6
Lines 5946 6287 +341
==========================================
+ Hits 2597 3270 +673
+ Misses 3349 3017 -332
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a great effort indeed. We'll need to be pumping out tests for the remaining templates. My only major concern is that some of the tests do not appear to be self contained? Or that depend on some execution made outside the test?
} | ||
} | ||
|
||
# |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?!
|
||
def test_generate_jsons(): | ||
""" | ||
Test if the returns from this function are the expected results |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We haven't done this so far, but it would be good to have more informative comments. Ideally:
- What is this function testing
- What is the expected result
assert os.path.isfile("{}_mapping.json".format(depth_file)) | ||
|
||
|
||
def test_generate_report(fetch_file): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this test depends on the execution of another?
Co-Authored-By: tiagofilipe12 <[email protected]>
3f055b4
to
485a794
Compare
Does anyone still remember why is this pending? 😆 |
This PR is a first implementation of the tests for python templates available in flowcraft (related with issue #148 ). The basic idea is to place each test under
flowcraft.tests.template_tests
in order to separate these tests from the core flowcraft tests.For now I have just added some tests to the
mash_screen
,mash_dist
andmapping_patlas
components, for example to check if files are generated. More complex templates might require other kinds of tests. But the idea here is to make your python templates as tested as possible in order to allow others to contribute without breaking functionality of the components.I have also changed the import in all templates so that they can be imported by pytest while running the tests.
This change is