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