MCPcopy Create free account
hub / github.com/davisking/dlib / test_pair

Function test_pair

tools/python/test/test_sparse_vector.py:9–25  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

7
8
9def test_pair():
10 p = pair(4, .9)
11 assert p.first == 4
12 assert p.second == .9
13
14 p.first = 3
15 p.second = .4
16
17 assert p.first == 3
18 assert p.second == .4
19
20 assert str(p) == "3: 0.4"
21 assert repr(p) == "dlib.pair(3, 0.4)"
22
23 deser = pickle.loads(pickle.dumps(p, 2))
24 assert deser.first == p.first
25 assert deser.second == p.second
26
27
28def test_sparse_vector():

Callers

nothing calls this directly

Calls 3

pairClass · 0.90
strClass · 0.85
reprFunction · 0.85

Tested by

no test coverage detected