def test_validate_invalid_type(self): field = BytesField(name='asdf') with pytest.raises(ValueError): field._validate(MockConfig(), 100)
def test_validate_str(self): field = BytesField() field._validate(MockConfig(), 'hello') == b'hello'
def test_validate_bytes(self): field = BytesField() assert field._validate(None, b'hello') == b'hello'
def test_validate_str(self): field = BytesField() field._validate(None, 'hello') == b'hello'