test: fix broken netifaces check

This will always return True on python2
[] > 1

On python3 it is instead an error, because you cannot compare a list to
an int -- instead, we want to compare the length of the returned list,
to see how many interfaces are available.
This commit is contained in:
Eli Schwartz 2019-03-26 01:20:18 -04:00
parent 2271463d27
commit 2c156d3000
No known key found for this signature in database
GPG Key ID: CEB167EFB5722BD6

View File

@ -254,7 +254,7 @@ class BuildTest(unittest.TestCase):
def test_netifaces(self): def test_netifaces(self):
import netifaces import netifaces
self.assertGreaterEqual(netifaces.interfaces(), 1, 'netifaces could find no network interfaces') self.assertGreaterEqual(len(netifaces.interfaces()), 1, 'netifaces could find no network interfaces')
def test_psutil(self): def test_psutil(self):
import psutil import psutil