File: test_axis_options.py

package info (click to toggle)
python-boost-histogram 1.7.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,236 kB
  • sloc: python: 7,940; cpp: 3,243; makefile: 22; sh: 1
file content (33 lines) | stat: -rw-r--r-- 927 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
from __future__ import annotations

from boost_histogram.axis import Traits


def test_compare():
    assert Traits() == Traits()
    assert Traits(underflow=True) == Traits(underflow=True)
    assert Traits(overflow=True) == Traits(overflow=True)
    assert Traits(circular=True) == Traits(circular=True)
    assert Traits(growth=True) == Traits(growth=True)
    assert Traits(underflow=True, overflow=True) == Traits(
        underflow=True, overflow=True
    )
    assert Traits() != Traits(overflow=True)
    assert Traits(underflow=True) != Traits(overflow=True)
    assert Traits(underflow=True, overflow=True) != Traits(overflow=True)


def test_fields():
    o = Traits()

    assert not o.underflow
    assert not o.overflow
    assert not o.circular
    assert not o.growth

    o = Traits(underflow=True, overflow=True)

    assert o.underflow
    assert o.overflow
    assert not o.circular
    assert not o.growth