diff options
Diffstat (limited to 'test_six.py')
-rw-r--r-- | test_six.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test_six.py b/test_six.py index 7e15a1c..3983528 100644 --- a/test_six.py +++ b/test_six.py @@ -356,6 +356,12 @@ def test_int2byte(): py.test.raises((OverflowError, ValueError), six.int2byte, 256) +def test_byte2int(): + assert six.byte2int(six.b("\x03")) == 3 + assert six.byte2int(six.b("\x03\x04")) == 3 + py.test.raises(IndexError, six.byte2int, six.b("")) + + def test_bytesindex(): assert six.indexbytes(six.b("hello"), 3) == ord("l") |