File: test_utils.py

package info (click to toggle)
sabctools 8.2.6-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 16,000 kB
  • sloc: cpp: 13,977; sh: 1,112; python: 950; ansic: 191; makefile: 13
file content (16 lines) | stat: -rw-r--r-- 402 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import pytest

from tests.testsupport import *


def test_bytearray_malloc():
    assert len(sabctools.bytearray_malloc(10)) == 10


def test_bytearray_malloc_bad_inputs():
    with pytest.raises(TypeError):
        sabctools.bytearray_malloc(10.0)
    with pytest.raises(SystemError):
        sabctools.bytearray_malloc(-1)
    with pytest.raises(TypeError):
        sabctools.bytearray_malloc("foo")