<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/NetworkManager.git/src/tests, branch main</title>
<subtitle>gitlab.freedesktop.org: NetworkManager/NetworkManager.git
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/'/>
<entry>
<title>test-client: drop TestNmClient base class from tests</title>
<updated>2023-05-15T12:59:58+00:00</updated>
<author>
<name>Thomas Haller</name>
<email>thaller@redhat.com</email>
</author>
<published>2023-05-11T09:26:56+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=efc14fcbec90cc057f37d8a4fca48c5b5b15b786'/>
<id>efc14fcbec90cc057f37d8a4fca48c5b5b15b786</id>
<content type='text'>
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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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.
</pre>
</div>
</content>
</entry>
<entry>
<title>test-client: move TestNmClient.ReplaceTextConUuid() to NMStubServer</title>
<updated>2023-05-15T12:59:58+00:00</updated>
<author>
<name>Thomas Haller</name>
<email>thaller@redhat.com</email>
</author>
<published>2023-05-11T09:09:07+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=50f97307c5e00157fdd29d3b61ee873f9cb5886b'/>
<id>50f97307c5e00157fdd29d3b61ee873f9cb5886b</id>
<content type='text'>
The goal is to make the base class TestNmClient smaller because it
contains a lot of state, and with inheritance it's hard to follow what
happens.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The goal is to make the base class TestNmClient smaller because it
contains a lot of state, and with inheritance it's hard to follow what
happens.
</pre>
</div>
</content>
</entry>
<entry>
<title>test-client: move TestNmClient.{cmd_construct_argv,_env}() to Util.cmd_create_{argv,env}()</title>
<updated>2023-05-15T12:59:58+00:00</updated>
<author>
<name>Thomas Haller</name>
<email>thaller@redhat.com</email>
</author>
<published>2023-05-11T08:55:50+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=1c32b59ebdd48b9a6315d4c29f72dcaabc645fe2'/>
<id>1c32b59ebdd48b9a6315d4c29f72dcaabc645fe2</id>
<content type='text'>
These two are stateless method, and even not only work for nmcli, but also for
nm-cloud-setup. Move to the Util class, as static methods.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
These two are stateless method, and even not only work for nmcli, but also for
nm-cloud-setup. Move to the Util class, as static methods.
</pre>
</div>
</content>
</entry>
<entry>
<title>test-client: move skip functions to Util class</title>
<updated>2023-05-15T12:59:58+00:00</updated>
<author>
<name>Thomas Haller</name>
<email>thaller@redhat.com</email>
</author>
<published>2023-05-11T07:33:07+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=7ecb65974394bfcf0d65c9b55a5b80880f0123b4'/>
<id>7ecb65974394bfcf0d65c9b55a5b80880f0123b4</id>
<content type='text'>
They can both be used as decorators and called plainly.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
They can both be used as decorators and called plainly.
</pre>
</div>
</content>
</entry>
<entry>
<title>test-client: move static function from TestNmClient._read_expected() to Util.file_read_expected()</title>
<updated>2023-05-15T12:59:58+00:00</updated>
<author>
<name>Thomas Haller</name>
<email>thaller@redhat.com</email>
</author>
<published>2023-05-11T07:12:47+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=d1e6edcb7beeeceedfc61a9bd59b06c2e37fe901'/>
<id>d1e6edcb7beeeceedfc61a9bd59b06c2e37fe901</id>
<content type='text'>
Static, state-less functions are great. Keep them separate from TestNmClient which
has lots of state.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Static, state-less functions are great. Keep them separate from TestNmClient which
has lots of state.
</pre>
</div>
</content>
</entry>
<entry>
<title>test/client: test cloud-setup GCP support</title>
<updated>2023-05-12T10:42:55+00:00</updated>
<author>
<name>Lubomir Rintel</name>
<email>lkundrak@v3.sk</email>
</author>
<published>2023-04-17T05:07:33+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=b93ebb9be931d4b6a73fd534f787478ce1c78bcb'/>
<id>b93ebb9be931d4b6a73fd534f787478ce1c78bcb</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>test/client: test cloud-setup azure support</title>
<updated>2023-05-12T10:42:55+00:00</updated>
<author>
<name>Lubomir Rintel</name>
<email>lkundrak@v3.sk</email>
</author>
<published>2023-04-17T05:07:56+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=661545efcd65b085a76494ab58f1565b0c0bd5ab'/>
<id>661545efcd65b085a76494ab58f1565b0c0bd5ab</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>test/client: test cloud-setup aliyun support</title>
<updated>2023-05-12T10:42:55+00:00</updated>
<author>
<name>Lubomir Rintel</name>
<email>lkundrak@v3.sk</email>
</author>
<published>2023-04-17T05:07:49+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=1f310abfd81f8f4fac8a2e761fe6aa6ae5e755d5'/>
<id>1f310abfd81f8f4fac8a2e761fe6aa6ae5e755d5</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>test-client: use a test fixture from the test</title>
<updated>2023-05-12T10:42:55+00:00</updated>
<author>
<name>Lubomir Rintel</name>
<email>lkundrak@v3.sk</email>
</author>
<published>2023-04-20T06:08:15+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=6a1dd3b0f818ddc5bf60d30bfa6bcc359323e4f6'/>
<id>6a1dd3b0f818ddc5bf60d30bfa6bcc359323e4f6</id>
<content type='text'>
Don't rely on resources provided by mock metadata server by default,
create the from within the test instead.

This allows for more flexibility, but the locality of the test fixture
relative to the tests makes the test more legible.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Don't rely on resources provided by mock metadata server by default,
create the from within the test instead.

This allows for more flexibility, but the locality of the test fixture
relative to the tests makes the test more legible.
</pre>
</div>
</content>
</entry>
<entry>
<title>test-client: factor out the test device setup</title>
<updated>2023-05-12T10:42:55+00:00</updated>
<author>
<name>Lubomir Rintel</name>
<email>lkundrak@v3.sk</email>
</author>
<published>2023-04-17T05:05:44+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=e56df68464cacc28553f515e1d2edcdfa690ead8'/>
<id>e56df68464cacc28553f515e1d2edcdfa690ead8</id>
<content type='text'>
We're going to reuse the setup for tests of other cloud providers.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We're going to reuse the setup for tests of other cloud providers.
</pre>
</div>
</content>
</entry>
</feed>
