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:
Daniel Grunwald 2017-01-20 23:22:45 +01:00
parent 3152ef22f0
commit e3d6ac2ca8
1 changed files with 2 additions and 2 deletions

View File

@ -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");
}
}