Beispiel #1
0
def test_extract_bytes_invalid():
    """Ensure that invalid input causes exception to be raised."""
    with pytest.raises(
            ValueError,
            match=r'^extract_bytes\(\) only accepts bytes '
            'and memoryview/buffer$',
    ):
        extract_bytes(u'some юнікод їїї')
def test_extract_bytes_invalid():
    """Ensure that invalid input causes exception to be raised."""
    with pytest.raises(ValueError):
        extract_bytes(u'some юнікод їїї')
def test_extract_bytes(input_argument, expected_result):
    """Check that legitimate inputs produce bytes."""
    assert extract_bytes(input_argument) == expected_result
Beispiel #4
0
def test_extract_bytes_invalid():
    """Ensure that invalid input causes exception to be raised."""
    with pytest.raises(ValueError):
        extract_bytes(u'some юнікод їїї')
Beispiel #5
0
def test_extract_bytes(input_argument, expected_result):
    """Check that legitimate inputs produce bytes."""
    assert extract_bytes(input_argument) == expected_result