Ejemplo n.º 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 юнікод їїї')
Ejemplo n.º 2
0
def test_extract_bytes_invalid():
    """Ensure that invalid input causes exception to be raised."""
    with pytest.raises(ValueError):
        extract_bytes(u'some юнікод їїї')
Ejemplo n.º 3
0
def test_extract_bytes(input_argument, expected_result):
    """Check that legitimate inputs produce bytes."""
    assert extract_bytes(input_argument) == expected_result
Ejemplo n.º 4
0
def test_extract_bytes_invalid():
    """Ensure that invalid input causes exception to be raised."""
    with pytest.raises(ValueError):
        extract_bytes(u'some юнікод їїї')
Ejemplo n.º 5
0
def test_extract_bytes(input_argument, expected_result):
    """Check that legitimate inputs produce bytes."""
    assert extract_bytes(input_argument) == expected_result