Reset IPv6 detection flag after IPv6 tests

Resets a module level flag that was being left in the
state that the previous test set it to. This was causing
unrelated tests to fail if the last state was left disabled.

Closes-Bug: #1365829
Change-Id: Id3f6cb680f5d832e21966de7d4fa335c0c59697c
This commit is contained in:
Kevin Benton 2014-09-04 21:55:47 -07:00
parent a47c6cfac4
commit aa2f708442
1 changed files with 5 additions and 1 deletions

View File

@ -56,7 +56,11 @@ class TestIsEnabled(base.BaseTestCase):
def setUp(self):
super(TestIsEnabled, self).setUp()
ipv6_utils._IS_IPV6_ENABLED = None
def reset_detection_flag():
ipv6_utils._IS_IPV6_ENABLED = None
reset_detection_flag()
self.addCleanup(reset_detection_flag)
self.mock_exists = mock.patch("os.path.exists",
return_value=True).start()
mock_open = mock.patch("__builtin__.open").start()