-
Notifications
You must be signed in to change notification settings - Fork 16
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
Chore : Code Coverage, Code Simplify #5
Conversation
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.
tests/test_generator.py
Outdated
generator_obj.api_dir = self.api_folder | ||
result = generator_obj.run() | ||
assert result == print("🎉 Your RESTful Article api resource is ready 🎉") | ||
result = self._extracted_from_test_run_6( |
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.
I Just revert test_run
to the old version. 48bf7ca
tests/test_generator.py
Outdated
generator_obj.core_dir = self.core_folder | ||
generator_obj.api_dir = self.api_folder | ||
generator_obj.generate_models() | ||
generator_obj = self._extracted_from_test_generate_models_3() |
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.
Codecov Report
@@ Coverage Diff @@
## main #5 +/- ##
==========================================
- Coverage 97.58% 97.55% -0.03%
==========================================
Files 9 9
Lines 248 245 -3
==========================================
- Hits 242 239 -3
Misses 6 6
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.
@yezz123 LGTM, thanks a lot 👍🏻
Code Coverage, Code Simplify 🚀
Overview
Function
Generator.get_fields_string
Function
is_present_in_file
Explanation
(a for a in b)
is a generator that returns all of the elements ofb
. If being passed into a function like any or all that takes a generator or sequence, it can simply be replaced byb
which is much clearer.Test Cases
in the
tests
folder, i find in the most of Test Cases Functions this little Style issueSimplify generator expression
, and i try to simplify them.Function
TestGenerator.test_run
, Instead, create a new class and place the fields and methods responsible for the relevant functionality in it.Function
TestGenerator.test_generate_models
, here you can Extract duplicate code into method.