| 1 |
# This test code was written by the `hypothesis.extra.ghostwriter` module |
| 2 |
# and is provided under the Creative Commons Zero public domain dedication. |
| 3 |
|
| 4 |
import base64 |
| 5 |
from hypothesis import given, strategies as st |
| 6 |
|
| 7 |
# TODO: replace st.nothing() with an appropriate strategy |
| 8 |
|
| 9 |
|
| 10 |
@given(altchars=st.none(), s=st.nothing(), validate=st.booleans()) |
| 11 |
def test_roundtrip_b64encode_b64decode(altchars, s, validate): |
| 12 |
value0 = base64.b64encode(s=s, altchars=altchars) |
| 13 |
value1 = base64.b64decode(s=value0, altchars=altchars, validate=validate) |
| 14 |
assert s == value1, (s, value1) |