Remove mox from nova/tests/unit/test_iptables_network.py
Replace stubs.Set() with mock.patch.object Part of blueprint remove-mox-newton Change-Id: Id2820d0908a302a05699de74d8e2a8f3bafb4c6d
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
# under the License.
|
||||
"""Unit Tests for network code."""
|
||||
|
||||
import mock
|
||||
import six
|
||||
|
||||
from nova.network import linux_net
|
||||
@@ -107,11 +108,9 @@ class IptablesManagerTestCase(test.NoDBTestCase):
|
||||
for table in six.itervalues(self.manager.ipv6):
|
||||
table.dirty = False
|
||||
|
||||
def error_apply():
|
||||
raise test.TestingException()
|
||||
|
||||
self.stubs.Set(self.manager, '_apply', error_apply)
|
||||
self.manager.apply()
|
||||
with mock.patch.object(self.manager, '_apply') as mock_apply:
|
||||
self.manager.apply()
|
||||
self.assertFalse(mock_apply.called)
|
||||
|
||||
def test_filter_rules_are_wrapped(self):
|
||||
current_lines = self.sample_filter
|
||||
|
||||
Reference in New Issue
Block a user