NetworkManager/src/tests/client
Thomas Haller efc14fcbec
test-client: drop TestNmClient base class from tests
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.
2023-05-15 14:59:58 +02:00
..
terminal-colors.d client/tests: move "clients/tests/test-client.py" to "src/tests/client/" 2021-03-15 17:10:55 +01:00
test-client.check-on-disk libnm,nmcli: add ipv6.dhcp-pd-hint property 2023-04-03 16:04:55 +02:00
meson.build tests/client: test nm-cloud-setup 2023-03-21 23:35:42 +01:00
test-client.py test-client: drop TestNmClient base class from tests 2023-05-15 14:59:58 +02:00
test-client.sh tests/client: test nm-cloud-setup 2023-03-21 23:35:42 +01:00