Fix ipv6 test and pytest collection

On some systems that test would fail because netifaces.AF_INET6 wound
have a different value than 10 (30 in my case).

Mocking it fixes the tests.

Also includes a fix that prevented running tests from pytest because
collection would fail due to .eggs folder.

Change-Id: Ic0be3ec3057adb969472fbbb5d8e257c4209d185
This commit is contained in:
Sorin Sbarnea 2019-08-28 11:27:59 +01:00
parent 3b62aa29af
commit bc0ae81699
2 changed files with 2 additions and 1 deletions

View File

@ -167,7 +167,7 @@ mistral.actions =
tripleo.role.list = tripleo_common.actions.plan:ListRolesAction
[tool:pytest]
norecursedirs = .git .tox dist
norecursedirs = .eggs .git .tox dist
log_cli = true
[flake8]

View File

@ -113,6 +113,7 @@ class TestImageUploadManager(base.TestCase):
@mock.patch('netifaces.ifaddresses')
@mock.patch('netifaces.interfaces')
@mock.patch('netifaces.AF_INET6', 10)
def test_get_undercloud_registry_ipv6(self, mock_interfaces,
mock_addresses):