"""Test for the text module.""" import pytest from owsrequest import text @pytest.mark.parametrize('value', ['', 'value', b'value', None]) def test_to_bytes(value): """Test transforming values into bytes.""" assert isinstance(text.to_bytes(value), bytes) if value: assert text.to_bytes(value) == b'value'