Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MacAddress objects are not being provided in UnitTests #184

Open
MichaelWasher opened this issue Aug 15, 2019 · 0 comments
Open

MacAddress objects are not being provided in UnitTests #184

MichaelWasher opened this issue Aug 15, 2019 · 0 comments

Comments

@MichaelWasher
Copy link
Contributor

MichaelWasher commented Aug 15, 2019

MacAddress objects are used to represent both the src_mac and port_id of packets in some functions. MacAddress objects should be used to represent mac values at all times, but due to Pythons use of duck-typing this has slipped through.

An example of this is here:
https://github.com/faucetsdn/chewie/blob/master/test/unit/test_chewie.py#L292-L299
https://github.com/faucetsdn/chewie/blob/master/test/unit/test_chewie_mocks.py#L47

The documentation of Chewie claims MacAddress is expected and is assumed below port_up() / port_down() functions.

Change the tests provide the correct object type and clean the use of mac address.
There should be no need for the use of str(port_id) as the __str__ function should be called internally in the log/print functions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant