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.
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.
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.
There was a problem hiding this comment.
And what about the fixture? Should it stay or not?
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.