<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/openstack/ironic-python-agent.git/ironic_python_agent/tests/unit/test_api.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>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>
<entry>
<title>Add missing 'autospec' argument to mock.patch</title>
<updated>2017-03-19T17:04:19+00:00</updated>
<author>
<name>John L. Villalovos</name>
<email>john.l.villalovos@intel.com</email>
</author>
<published>2017-03-19T15:30:25+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/openstack/ironic-python-agent.git/commit/?id=1695cb18c25f2afed27309fd4602dc91ba741864'/>
<id>1695cb18c25f2afed27309fd4602dc91ba741864</id>
<content type='text'>
Add missing 'autospec' keyword argument to mock.patch and
mock.patch.object calls. Use 'autospec=True' except for a few cases
where it fails because the mocked function is a @classmethod and it
doesn't work. In that case explicity set it to 'autospec=False'

Change-Id: I620dce91abaa4440e1803aeefb3e93c0b65d1419
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add missing 'autospec' keyword argument to mock.patch and
mock.patch.object calls. Use 'autospec=True' except for a few cases
where it fails because the mocked function is a @classmethod and it
doesn't work. In that case explicity set it to 'autospec=False'

Change-Id: I620dce91abaa4440e1803aeefb3e93c0b65d1419
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge "Removes the use of mutables as default args"</title>
<updated>2016-06-20T17:25:29+00:00</updated>
<author>
<name>Jenkins</name>
<email>jenkins@review.openstack.org</email>
</author>
<published>2016-06-20T17:25:29+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/openstack/ironic-python-agent.git/commit/?id=d63820af12dcf4850d867aad20d31a274655013e'/>
<id>d63820af12dcf4850d867aad20d31a274655013e</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Removes the use of mutables as default args</title>
<updated>2016-06-20T06:08:12+00:00</updated>
<author>
<name>Edan David</name>
<email>edand@mellanox.com</email>
</author>
<published>2016-06-19T09:52:11+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/openstack/ironic-python-agent.git/commit/?id=438c69af7c6ce8f33ab64cff2f470ac0cd35ef30'/>
<id>438c69af7c6ce8f33ab64cff2f470ac0cd35ef30</id>
<content type='text'>
Passing mutable objects as default args is a known Python pitfall.
We'd better avoid this. This commit changes mutable default args with
None, 'arg = [] if arg is None else arg'.

TrivialFix

Change-Id: I384b24e81543999a8b873e3223cd409ed799ffa0
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Passing mutable objects as default args is a known Python pitfall.
We'd better avoid this. This commit changes mutable default args with
None, 'arg = [] if arg is None else arg'.

TrivialFix

Change-Id: I384b24e81543999a8b873e3223cd409ed799ffa0
</pre>
</div>
</content>
</entry>
<entry>
<title>Use assertIn and assertNotIn</title>
<updated>2016-06-17T16:01:43+00:00</updated>
<author>
<name>Edan David</name>
<email>edand@mellanox.com</email>
</author>
<published>2016-06-16T10:40:03+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/openstack/ironic-python-agent.git/commit/?id=1e8652a8d038c3795b903c9eba02a6b0a8a5b872'/>
<id>1e8652a8d038c3795b903c9eba02a6b0a8a5b872</id>
<content type='text'>
Tests should use:
  self.assertIn(value, list)
  self.assertNotIn(value, list)

instead of:
  self.assertTrue(value in list)
  self.assertFalse(value in list)

because assertIn and assertNotIn raise more meaningful errors:
  self.assertIn(3, [1, 2]
  &gt;&gt;&gt; MismatchError: 3 not in [1, 2]

  self.assertTrue(3 in [1, 2])
  &gt;&gt;&gt; AssertionError: False is not true

Change-Id: I2d1c78fe71fe03e350b1035123b0a48b7186a6ec
Closes-Bug: #1510007
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Tests should use:
  self.assertIn(value, list)
  self.assertNotIn(value, list)

instead of:
  self.assertTrue(value in list)
  self.assertFalse(value in list)

because assertIn and assertNotIn raise more meaningful errors:
  self.assertIn(3, [1, 2]
  &gt;&gt;&gt; MismatchError: 3 not in [1, 2]

  self.assertTrue(3 in [1, 2])
  &gt;&gt;&gt; AssertionError: False is not true

Change-Id: I2d1c78fe71fe03e350b1035123b0a48b7186a6ec
Closes-Bug: #1510007
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove unused parameter</title>
<updated>2016-06-14T14:21:26+00:00</updated>
<author>
<name>Edan David</name>
<email>edand@mellanox.com</email>
</author>
<published>2016-06-14T14:18:53+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/openstack/ironic-python-agent.git/commit/?id=fda09be3191017536f7c6e377dc9f3d77469535a'/>
<id>fda09be3191017536f7c6e377dc9f3d77469535a</id>
<content type='text'>
unit.test_api have an unused parameter in _make_app.

Change-Id: I1e313803e43a0e69c547695333116cc0432043da
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
unit.test_api have an unused parameter in _make_app.

Change-Id: I1e313803e43a0e69c547695333116cc0432043da
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix params order in assertEqual</title>
<updated>2016-01-13T02:03:11+00:00</updated>
<author>
<name>Kan</name>
<email>kansks@cn.ibm.com</email>
</author>
<published>2016-01-12T09:03:19+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/openstack/ironic-python-agent.git/commit/?id=2b07976b948d0e768e2b46c5b63ee454e5f8aeb2'/>
<id>2b07976b948d0e768e2b46c5b63ee454e5f8aeb2</id>
<content type='text'>
Fix params order to correspond to real signature:
    assertEqual(expected, actual)

Change-Id: I129aad5d8bb7ca0541c07913cb5edd8eef9e90ba
Closes-Bug: #1277104
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fix params order to correspond to real signature:
    assertEqual(expected, actual)

Change-Id: I129aad5d8bb7ca0541c07913cb5edd8eef9e90ba
Closes-Bug: #1277104
</pre>
</div>
</content>
</entry>
<entry>
<title>Add base for IPA functional tests</title>
<updated>2015-08-18T16:19:47+00:00</updated>
<author>
<name>Josh Gachnang</name>
<email>josh@pcsforeducation.com</email>
</author>
<published>2015-08-14T16:51:57+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/openstack/ironic-python-agent.git/commit/?id=fb2790774d97f9746f0c0e39ddff3f94588a8521'/>
<id>fb2790774d97f9746f0c0e39ddff3f94588a8521</id>
<content type='text'>
Starts up an agent in a thread and then runs functional tests against
it.

Add the first functional test of the API: a simple test of the
commands API.

Co-Authored-By: Mario Villaplana &lt;mario.villaplana@gmail.com&gt;
Change-Id: If4ad611929d388a2a9454224646cb296bd0ba0ce
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Starts up an agent in a thread and then runs functional tests against
it.

Add the first functional test of the API: a simple test of the
commands API.

Co-Authored-By: Mario Villaplana &lt;mario.villaplana@gmail.com&gt;
Change-Id: If4ad611929d388a2a9454224646cb296bd0ba0ce
</pre>
</div>
</content>
</entry>
</feed>
