FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
validators/tests/test_mac_address.py at 0.35.0 · python-validators/validators · GitHub
python-validators
validators
Repository navigation
Code
Issues
Pull requests
4
(4)
Discussions
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
validators
/
tests
/
test_mac_address.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
35 lines (29 loc) · 820 Bytes
Breadcrumbs
validators
/
tests
/
test_mac_address.py
Copy path
File metadata and controls
35 lines (29 loc) · 820 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
"""MAC Address."""
# external
import
pytest
# local
from
validators
import
ValidationError
,
mac_address
@
pytest
.
mark
.
parametrize
(
(
"address"
,),
[
(
"01:23:45:67:ab:CD"
,),
(
"01-23-45-67-ab-CD"
,),
(
"01:2F:45:37:ab:CD"
,),
(
"A1-2F-4E-68-ab-CD"
,),
],
)
def
test_returns_true_on_valid_mac_address
(
address
:
str
):
"""Test returns true on valid mac address."""
assert
mac_address
(
address
)
@
pytest
.
mark
.
parametrize
(
(
"address"
,),
[
(
"00-00:-00-00-00"
,),
(
"01:23:45:67:89:"
,),
(
"01:23-45:67-89:gh"
,),
(
"123:23:45:67:89:00"
,),
],
)
def
test_returns_failed_validation_on_invalid_mac_address
(
address
:
str
):
"""Test returns failed validation on invalid mac address."""
assert
isinstance
(
mac_address
(
address
),
ValidationError
)
Back
|
FazBrowse Home
|
New Git URL