Test extracting Vec<u8> using bytearray instead of bytes: On Python 2.7, the sequence protocol on bytes returns characters, not integers.
This commit is contained in:
parent
3152ef22f0
commit
e3d6ac2ca8
|
@ -509,10 +509,10 @@ mod test {
|
|||
}
|
||||
|
||||
#[test]
|
||||
fn test_extract_bytes_to_vec() {
|
||||
fn test_extract_bytearray_to_vec() {
|
||||
let gil = Python::acquire_gil();
|
||||
let py = gil.python();
|
||||
let v: Vec<u8> = py.eval("b'abc'", None, None).unwrap().extract(py).unwrap();
|
||||
let v: Vec<u8> = py.eval("bytearray(b'abc')", None, None).unwrap().extract(py).unwrap();
|
||||
assert!(v == b"abc");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue