def test_to_nbytes_incorrect(arg): with raises(ValueError): to_nbytes(arg)
def test_to_nbytes_correct(arg, expected): n = to_nbytes(arg) assert n == expected