-
Notifications
You must be signed in to change notification settings - Fork 14.2k
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
Add fudament for API based on connexion #8149
Conversation
0ddd5bf
to
32ddbc2
Compare
6773bd3
to
0e73b0c
Compare
da95c36
to
54bde13
Compare
9afa53b
to
74ae716
Compare
74ae716
to
0384644
Compare
class TestConnectionEndpoint(unittest.TestCase): | ||
@classmethod | ||
def setUpClass(cls) -> None: | ||
super().setUpClass() | ||
cls.app = app.create_app(testing=True) # type:ignore | ||
|
||
def setUp(self) -> None: | ||
self.client = self.app.test_client() # type:ignore |
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 class code is repeated in each test file. Also we have http_client
fixture which also provides the app 😸
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.
Yes. There are so many repetitions in this code because it is a skeleton. I hope that soon this code will be more different. I didn't want to introduce 3-level inheritance here, because it would complicate the tests excessively. This is ok if the code is repeated because it makes the code much simpler and less complex. Now each test file is not dependent on anything and each person can work independently.
Here is an article about it: https://testing.googleblog.com/2019/12/testing-on-toilet-tests-too-dry-make.html
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.
And what about the fixture? Should it stay or not?
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 removed fixture: 6c765df
Thanks.
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.
LGTM
Close: #8109
Make sure to mark the boxes below before creating PR: [x]
In case of fundamental code change, Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in UPDATING.md.
Read the Pull Request Guidelines for more information.