File: test_getset_attr.py

package info (click to toggle)
pyranges 0.0.111%2Bds-10
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 20,996 kB
  • sloc: python: 5,546; makefile: 37; sh: 6
file content (21 lines) | stat: -rw-r--r-- 430 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import pytest


def test_getsetattr(chip_10):

    chip_10.whatevz = list(range(len(chip_10)))

    assert (chip_10.whatevz == list(range(len(chip_10)))).all()


def test_getsetattr_fails(chip_10):

    with pytest.raises(Exception):
        chip_10.whatevz = range(len(chip_10) + 1)


def test_getsetattr_with_str(chip_10):

    chip_10.whatevz = "whatevz"

    assert (chip_10.whatevz == list(["whatevz"] * len(chip_10))).all()