<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/openstack/ironic-python-agent.git/ironic_python_agent/tests/unit/base.py, branch 3.2.0</title>
<subtitle>opendev.org: openstack/ironic-python-agent.git
</subtitle>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/openstack/ironic-python-agent.git/'/>
<entry>
<title>Fix issue with double mocking of utils.execute functions</title>
<updated>2017-12-01T15:42:02+00:00</updated>
<author>
<name>John L. Villalovos</name>
<email>john.l.villalovos@intel.com</email>
</author>
<published>2017-11-30T18:16:51+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/openstack/ironic-python-agent.git/commit/?id=fc3de874693edb8205b4fc14a60b55e140434d94'/>
<id>fc3de874693edb8205b4fc14a60b55e140434d94</id>
<content type='text'>
An issue was discovered if we mock an already mock-ed function. This
was happening in our execute() detection code. Change it to not use a
mock and instead a function.

Add unit tests to show it works as intended.

Change-Id: Ia116b355e7adb3cbfb8ae34f4d59bf527f2889bb
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
An issue was discovered if we mock an already mock-ed function. This
was happening in our execute() detection code. Change it to not use a
mock and instead a function.

Add unit tests to show it works as intended.

Change-Id: Ia116b355e7adb3cbfb8ae34f4d59bf527f2889bb
</pre>
</div>
</content>
</entry>
<entry>
<title>Use oslo_config.fixture in unit tests</title>
<updated>2017-11-09T15:01:26+00:00</updated>
<author>
<name>Vasyl Saienko</name>
<email>vsaienko@mirantis.com</email>
</author>
<published>2017-11-09T14:58:50+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/openstack/ironic-python-agent.git/commit/?id=c4f10dce1391fd5183c36669dd19dbf1a95efcd9'/>
<id>c4f10dce1391fd5183c36669dd19dbf1a95efcd9</id>
<content type='text'>
It provides cleaner per-tests config objects, with more options to
configure the fixture.

Also, allow overriding config fixture in particular test cases if
needed.

Change-Id: I2e9945b6168d97d7ee861924ac2f4ca5cd03dde2
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It provides cleaner per-tests config objects, with more options to
configure the fixture.

Also, allow overriding config fixture in particular test cases if
needed.

Change-Id: I2e9945b6168d97d7ee861924ac2f4ca5cd03dde2
</pre>
</div>
</content>
</entry>
<entry>
<title>Improve the catching of calls to 'execute' related functions</title>
<updated>2017-10-23T15:44:23+00:00</updated>
<author>
<name>John L. Villalovos</name>
<email>john.l.villalovos@intel.com</email>
</author>
<published>2017-05-17T18:00:38+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/openstack/ironic-python-agent.git/commit/?id=ef838dd6bbb8d3c830a69ff2bf6a21b90b9adfaf'/>
<id>ef838dd6bbb8d3c830a69ff2bf6a21b90b9adfaf</id>
<content type='text'>
Improve the catching of calls to 'execute' related functions in unit
tests. Before we only caught calls to utils.execute(). Now we catch
calls to:

    ironic_lib.utils.execute()
    processutils.execute()
    subprocess.call()
    subprocess.check_call()
    subprocess.check_output()
    utils.execute()

Change-Id: If4720ebed00f15c2a19cb8badbe4dc3c808eeece
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Improve the catching of calls to 'execute' related functions in unit
tests. Before we only caught calls to utils.execute(). Now we catch
calls to:

    ironic_lib.utils.execute()
    processutils.execute()
    subprocess.call()
    subprocess.check_call()
    subprocess.check_output()
    utils.execute()

Change-Id: If4720ebed00f15c2a19cb8badbe4dc3c808eeece
</pre>
</div>
</content>
</entry>
<entry>
<title>Prevent tests' unmocked access to utils.execute()</title>
<updated>2017-05-15T00:48:43+00:00</updated>
<author>
<name>Julian Edwards</name>
<email>bigjools@gmail.com</email>
</author>
<published>2017-04-03T05:32:44+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/openstack/ironic-python-agent.git/commit/?id=f57cbccf8b146152eacd99787a7ccc1097b80055'/>
<id>f57cbccf8b146152eacd99787a7ccc1097b80055</id>
<content type='text'>
This change introduces a new base test class that mocks out
utils.execute and forces an exception if it gets called.
This has rooted out many tests that were doing this as a side effect of
calling other functions, doing things like modprobe and running iscsi
on the host's actual machine.

The tests are all now appropriately patched in places where this was
happening, and the new base class permanently prevents this from
accidentally happening again.

If you really want to call utils.execute() then you need to re-mock it
in your unit test.

Change-Id: Idf87d09a9c01a6bfe2767f8becabe65c02983518
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This change introduces a new base test class that mocks out
utils.execute and forces an exception if it gets called.
This has rooted out many tests that were doing this as a side effect of
calling other functions, doing things like modprobe and running iscsi
on the host's actual machine.

The tests are all now appropriately patched in places where this was
happening, and the new base class permanently prevents this from
accidentally happening again.

If you really want to call utils.execute() then you need to re-mock it
in your unit test.

Change-Id: Idf87d09a9c01a6bfe2767f8becabe65c02983518
</pre>
</div>
</content>
</entry>
</feed>
