Cleanup test_net.py#4840
Conversation
This was purely to help my editor deal with a file that was almost 10000 lines.
This was mostly done automatically using `pytestify`
We have commented tests that are years old. Git will keep the history if we ever need to bring them back. I left the TODO in place as that can still be a reminder that they are needed Also remove some debug code from test_bond_config
|
Hello! Thank you for this proposed change to cloud-init. This pull request is now marked as stale as it has not seen any activity in 14 days. If no activity occurs within the next 7 days, this pull request will automatically close. If you are waiting for code review and you are seeing this message, apologies! Please reply, tagging TheRealFalcon, and he will ensure that someone takes a look soon. (If the pull request is closed and you would like to continue working on it, please do tag TheRealFalcon to reopen it.) |
blackboxsw
left a comment
There was a problem hiding this comment.
Much cleaner to look at and reason about. Thx for catching and documenting the failed/misspelled test-cases.
| return_value="root=/dev/sda1", | ||
| ) | ||
| self.tmp_dir = lambda: str(tmpdir) | ||
| self.tmp_dir = lambda: str(tmpdir_factory.mktemp("a", numbered=True)) |
There was a problem hiding this comment.
Nice idea here. good point of reference for comparison of failed test output after the fact too.
| self._assert_headers(found) | ||
|
|
||
| def test_small_config_v2(self): | ||
| entry = NETWORK_CONFIGS["small_v1"] |
There was a problem hiding this comment.
Finally getting test coverage on small_v2 for SUSE. :)
|
+1 on the squash here. it was helpful for the review to have separate commts, but it's not really a functional set of differences that I'd see future-me wanting to distinguish. |
test: cleanup test_net.py * Move ~3500 lines of network config into its own file * Replace unittest idioms with pytest idioms * Remove CiTestCase and FilesystemMockingTestCase * Parametrize the obvious tests * Remove commented tests and debug print statements Much of the heavy lifting was done using `pytestify`. Moving configuration into another file was mainly because the file is way too large. We have commented tests that are years old. Git will keep the history if we ever need to bring them back. I left the TODO in place as that can still be a reminder that they are needed.
Proposed Commit Message
Additional Context
There's still more that could be done here, but I want to stop here after most of the "easy" changes.
Commits are technically independently applicable, but I think I'd rather squash merge the whole thing as my current commits are fairly noisy. A few of the commits will have some extra context in the commit message though.
Merge type