-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
21 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import pytest | ||
|
||
from nav.models.oui import OUI | ||
|
||
|
||
class TestOUI: | ||
def test_should_give_error_if_less_than_6_characters(self): | ||
with pytest.raises(ValueError): | ||
OUI(oui="AABB", vendor="myvendor") | ||
|
||
def test_should_give_error_if_morethan_6_characters(self): | ||
with pytest.raises(ValueError): | ||
OUI(oui="AABBCCDD", vendor="myvendor") | ||
|
||
def test_should_allow_oid_with_6_characters(self): | ||
OUI(oui="AABBCC", vendor="myvendor") | ||
|
||
def test_string_representation_should_match_oid(self): | ||
oui_string = "AABBCC" | ||
oui = OUI(oui=oui_string, vendor="myvendor") | ||
assert str(oui) == oui_string |