Skip to content
This repository has been archived by the owner on Apr 22, 2024. It is now read-only.

Commit

Permalink
Fix linter issues
Browse files Browse the repository at this point in the history
  • Loading branch information
cmagnobarbosa committed Sep 1, 2020
2 parents 15d8f29 + 0c149da commit bdc5378
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
4 changes: 4 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ def run(self):
check_call(cmd, shell=True)
except CalledProcessError as exc:
print(exc)
print('Unit tests failed. Fix the error(s) above and try again.')
sys.exit(-1)


class TestCoverage(Test):
Expand All @@ -147,6 +149,8 @@ def run(self):
check_call(cmd, shell=True)
except CalledProcessError as exc:
print(exc)
print('Coverage tests failed. Fix the errors above and try again.')
sys.exit(-1)


class DocTest(SimpleCommand):
Expand Down
15 changes: 6 additions & 9 deletions tests/unit/test_core/test_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,28 +125,25 @@ def test_10_mega_speed(self):
def test_speed_setter(self):
"""Should return speed that was set and not features'."""
expected_speed = 12345
self.iface.features = PortFeatures.OFPPF_10MB_FD
self.iface.set_custom_speed(expected_speed)
actual_speed = self.iface.speed
self.assertEqual(expected_speed, actual_speed)

def test_speed_in_constructor(self):
"""Custom speed should override features'."""
expected_speed = 6789
iface = self._get_v0x04_iface(speed=expected_speed,
features=PortFeatures.OFPPF_10MB_FD)
actual_speed = iface.speed
self.assertEqual(expected_speed, actual_speed)
iface = self._get_v0x04_iface(speed=expected_speed)
self.assertEqual(expected_speed, iface.speed)

def test_remove_custom_speed(self):
"""Should return features' speed again when custom's becomes None."""
def test_speed_removing_features(self):
"""Should return custom speed again when features becomes None."""
custom_speed = 101112
of_speed = 10 * 10**6 / 8
iface = self._get_v0x04_iface(speed=custom_speed,
features=PortFeatures.OFPPF_10MB_FD)
self.assertEqual(custom_speed, iface.speed)
iface.set_custom_speed(None)
self.assertEqual(of_speed, iface.speed)
iface.features = None
self.assertEqual(custom_speed, iface.speed)

def test_interface_available_tags(self):
"""Test available_tags on Interface class."""
Expand Down

0 comments on commit bdc5378

Please sign in to comment.