re-import sources as agreed with the maintainer
This commit is contained in:
parent
8ad47de44e
commit
207eee8c0f
4
.gitignore
vendored
4
.gitignore
vendored
@ -1,2 +1,4 @@
|
|||||||
SOURCES/netifaces-0.10.6.tar.gz
|
/netifaces-0.5.tar.gz
|
||||||
|
/netifaces-0.10.4.tar.gz
|
||||||
|
/netifaces-0.10.5.tar.gz
|
||||||
/netifaces-0.10.6.tar.gz
|
/netifaces-0.10.6.tar.gz
|
||||||
|
30
tests/test_netifaces.py
Normal file
30
tests/test_netifaces.py
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
import netifaces
|
||||||
|
import pytest
|
||||||
|
|
||||||
|
|
||||||
|
def test_interfaces():
|
||||||
|
ifaces = netifaces.interfaces()
|
||||||
|
assert isinstance(ifaces, list)
|
||||||
|
assert "lo" in ifaces
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.parametrize(
|
||||||
|
"iface,af,expected",
|
||||||
|
[
|
||||||
|
("lo", netifaces.AF_INET, "127.0.0.1"),
|
||||||
|
("lo", netifaces.AF_INET6, "::1"),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
def test_ifaddresses_lo(iface, af, expected):
|
||||||
|
addrs = netifaces.ifaddresses(iface)
|
||||||
|
assert addrs[af][0]["addr"] == expected
|
||||||
|
|
||||||
|
|
||||||
|
def test_invalid():
|
||||||
|
with pytest.raises(ValueError):
|
||||||
|
netifaces.ifaddresses("invalid interface")
|
||||||
|
|
||||||
|
|
||||||
|
def test_gateways():
|
||||||
|
gw = netifaces.gateways()
|
||||||
|
assert "default" in gw
|
13
tests/tests.yml
Normal file
13
tests/tests.yml
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
---
|
||||||
|
- hosts: localhost
|
||||||
|
tags:
|
||||||
|
- classic
|
||||||
|
roles:
|
||||||
|
- role: standard-test-basic
|
||||||
|
required_packages:
|
||||||
|
- python3-netifaces
|
||||||
|
- python3-pytest
|
||||||
|
tests:
|
||||||
|
- unittests:
|
||||||
|
dir: "."
|
||||||
|
run: pytest-3 test_netifaces.py
|
Loading…
Reference in New Issue
Block a user