summaryrefslogtreecommitdiffstats
path: root/ml/dlib/tools/python/test/test_point.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-05 12:08:03 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-05 12:08:18 +0000
commit5da14042f70711ea5cf66e034699730335462f66 (patch)
tree0f6354ccac934ed87a2d555f45be4c831cf92f4a /ml/dlib/tools/python/test/test_point.py
parentReleasing debian version 1.44.3-2. (diff)
downloadnetdata-5da14042f70711ea5cf66e034699730335462f66.tar.xz
netdata-5da14042f70711ea5cf66e034699730335462f66.zip
Merging upstream version 1.45.3+dfsg.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'ml/dlib/tools/python/test/test_point.py')
-rw-r--r--ml/dlib/tools/python/test/test_point.py48
1 files changed, 0 insertions, 48 deletions
diff --git a/ml/dlib/tools/python/test/test_point.py b/ml/dlib/tools/python/test/test_point.py
deleted file mode 100644
index 75b8c191f..000000000
--- a/ml/dlib/tools/python/test/test_point.py
+++ /dev/null
@@ -1,48 +0,0 @@
-from dlib import point, points
-try:
- import cPickle as pickle # Use cPickle on Python 2.7
-except ImportError:
- import pickle
-
-
-def test_point():
- p = point(27, 42)
- assert repr(p) == "point(27, 42)"
- assert str(p) == "(27, 42)"
- assert p.x == 27
- assert p.y == 42
- ser = pickle.dumps(p, 2)
- deser = pickle.loads(ser)
- assert deser.x == p.x
- assert deser.y == p.y
-
-
-def test_point_init_kwargs():
- p = point(y=27, x=42)
- assert repr(p) == "point(42, 27)"
- assert str(p) == "(42, 27)"
- assert p.x == 42
- assert p.y == 27
-
-
-def test_points():
- ps = points()
-
- ps.resize(5)
- assert len(ps) == 5
- for i in range(5):
- assert ps[i].x == 0
- assert ps[i].y == 0
-
- ps.clear()
- assert len(ps) == 0
-
- ps.extend([point(1, 2), point(3, 4)])
- assert len(ps) == 2
-
- ser = pickle.dumps(ps, 2)
- deser = pickle.loads(ser)
- assert deser[0].x == 1
- assert deser[0].y == 2
- assert deser[1].x == 3
- assert deser[1].y == 4