mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-11 08:40:19 +01:00
With the unit test framework, we define special methods, like setUp() and test_*(). This is documented, but not obvious. Previously, TestNmClient was the base class for our tests classes, and it provided some functionality (and state). It was utterly confusing how pieces fit together. Instead, move the state to a new class NMTestContext(). That contains most of the code from TestNmClient. Drop TestNmClient and let the test classes directly descend from unittest.TestCase. The difference is, when you now look at a certain test (test_001()), you can easier understand which code runs when. First, the test class has a setUp() method which runs, but that method is now trivial without extra context. Second, there is the @nm_test attribute that wraps the function. But that's it. It's all at one place, and we delegate instead of inherit. |
||
|---|---|---|
| .. | ||
| terminal-colors.d | ||
| test-client.check-on-disk | ||
| meson.build | ||
| test-client.py | ||
| test-client.sh | ||