-
-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathtest_wrappers_nodecoords.py
41 lines (31 loc) · 1017 Bytes
/
test_wrappers_nodecoords.py
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
34
35
36
37
38
39
40
41
import pytest
from yamlpath.wrappers import NodeCoords
class Test_wrappers_NodeCoords():
"""Tests for the NodeCoords class."""
def test_generic(self):
node_coord = NodeCoords([], None, None)
def test_repr(self):
node_coord = NodeCoords([], None, None)
assert repr(node_coord) == "NodeCoords('[]', 'None', 'None')"
def test_str(self):
node_coord = NodeCoords([], None, None)
assert str(node_coord) == "[]"
def test_gt(self):
lhs_nc = NodeCoords(5, None, None)
rhs_nc = NodeCoords(3, None, None)
assert lhs_nc > rhs_nc
def test_null_gt(self):
lhs_nc = NodeCoords(5, None, None)
rhs_nc = NodeCoords(None, None, None)
assert not lhs_nc > rhs_nc
def test_lt(self):
lhs_nc = NodeCoords(5, None, None)
rhs_nc = NodeCoords(7, None, None)
assert lhs_nc < rhs_nc
def test_null_lt(self):
lhs_nc = NodeCoords(5, None, None)
rhs_nc = NodeCoords(None, None, None)
assert not lhs_nc < rhs_nc
def test_isa_null(self):
nc = NodeCoords(None, None, None)
assert nc.wraps_a(None)