2020-03-12 22:27:22 +01:00
|
|
|
import hypothesis.strategies._internal.core as st
|
|
|
|
from hypothesis.strategies._internal.strategies import SearchStrategy
|
|
|
|
|
|
|
|
|
2021-07-05 00:10:59 +02:00
|
|
|
@st.defines_strategy(force_reusable_values=True)
|
2022-10-05 09:09:27 +02:00
|
|
|
def mac_addr_strings() -> SearchStrategy[str]:
|
2020-03-12 22:27:22 +01:00
|
|
|
"""A strategy for MAC address strings.
|
|
|
|
|
|
|
|
This consists of six strings representing integers [0..255],
|
|
|
|
without zero-padding, joined by dots.
|
|
|
|
"""
|
2021-03-07 20:03:16 +01:00
|
|
|
return st.builds(
|
|
|
|
"{:02X}:{:02X}:{:02X}:{:02X}:{:02X}:{:02X}".format, *(6 * [st.integers(0, 255)])
|
|
|
|
)
|