Skip to content
This repository was archived by the owner on Apr 13, 2021. It is now read-only.

Commit 460d431

Browse files
committed
Add test for NavMsg._equal
1 parent 9ce048f commit 460d431

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

python/tests/test_nav_msg.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,20 @@ def test_instantiate():
4141
def test_build_nav_msg():
4242
build_nav_msg()
4343

44+
def test_equal():
45+
nm_a = build_nav_msg()
46+
nm_b = build_nav_msg()
47+
48+
# Change nm_b's fields slightly.
49+
nm_b_dict = nm_b.to_dict()
50+
nm_b_dict['bit_polarity'] = 1
51+
nm_b.from_dict(nm_b_dict)
52+
53+
assert nm_a._equal(nm_a)
54+
assert nm_b._equal(nm_b)
55+
assert not nm_a._equal(nm_b)
56+
assert not nm_b._equal(nm_a)
57+
4458
def test_richcmp():
4559
nm_a = build_nav_msg()
4660
nm_b = build_nav_msg()

0 commit comments

Comments
 (0)