Merge lp:~gocept/landscape-client/py3-monitor-packagemonitor into lp:~landscape/landscape-client/trunk

Proposed by Steffen Allner
Status: Merged
Approved by: Eric Snow
Approved revision: 997
Merged at revision: 994
Proposed branch: lp:~gocept/landscape-client/py3-monitor-packagemonitor
Merge into: lp:~landscape/landscape-client/trunk
Prerequisite: lp:~gocept/landscape-client/py3-monitor-networkactivity
Diff against target: 40 lines (+7/-6)
2 files modified
landscape/monitor/tests/test_packagemonitor.py (+6/-6)
py3_ready_tests (+1/-0)
To merge this branch: bzr merge lp:~gocept/landscape-client/py3-monitor-packagemonitor
Reviewer Review Type Date Requested Status
Eric Snow (community) Approve
Daniel Havlik (community) Approve
Geoff Teale (community) Approve
🤖 Landscape Builder test results Approve
Review via email: mp+321416@code.launchpad.net

Commit message

This is the Py3 port of landscape.monitor.packagemonitor.

It fixes some bytes/unicode issues in the tests.

Description of the change

This MPs adjust tests for landscape.monitor.packagemonitor for Python 3 and declares hashes explicitly as bytes.

To post a comment you must log in.
Revision history for this message
🤖 Landscape Builder (landscape-builder) :
review: Abstain (executing tests)
Revision history for this message
🤖 Landscape Builder (landscape-builder) wrote :

Command: TRIAL_ARGS=-j4 make ci-check
Result: Success
Revno: 997
Branch: lp:~gocept/landscape-client/py3-monitor-packagemonitor
Jenkins: https://ci.lscape.net/job/latch-test-xenial/3820/

review: Approve (test results)
Revision history for this message
Geoff Teale (tealeg) wrote :

+1 Approve

review: Approve
Revision history for this message
Daniel Havlik (nilo) wrote :

+1

review: Approve
Revision history for this message
Eric Snow (ericsnowcurrently) wrote :

LGTM

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'landscape/monitor/tests/test_packagemonitor.py'
2--- landscape/monitor/tests/test_packagemonitor.py 2017-01-09 14:29:54 +0000
3+++ landscape/monitor/tests/test_packagemonitor.py 2017-03-30 08:01:23 +0000
4@@ -308,12 +308,12 @@
5 The package hash=>id map is server-specific, so when we change
6 servers, we should reset this map.
7 """
8- self.package_store.set_hash_ids({"hash1": 1, "hash2": 2})
9+ self.package_store.set_hash_ids({b"hash1": 1, b"hash2": 2})
10 self.monitor.add(self.package_monitor)
11 self.monitor.reactor.fire("server-uuid-changed", "old", "new")
12
13- self.assertEqual(self.package_store.get_hash_id("hash1"), None)
14- self.assertEqual(self.package_store.get_hash_id("hash2"), None)
15+ self.assertEqual(self.package_store.get_hash_id(b"hash1"), None)
16+ self.assertEqual(self.package_store.get_hash_id(b"hash2"), None)
17
18 def test_changing_server_uuid_wont_clear_hash_ids_with_old_uuid_none(self):
19 """
20@@ -321,8 +321,8 @@
21 talking to a server that knows how to communicate its UUID, so we
22 don't want to clear the old hashes in this case.
23 """
24- self.package_store.set_hash_ids({"hash1": 1, "hash2": 2})
25+ self.package_store.set_hash_ids({b"hash1": 1, b"hash2": 2})
26 self.monitor.add(self.package_monitor)
27 self.monitor.reactor.fire("server-uuid-changed", None, "new-uuid")
28- self.assertEqual(self.package_store.get_hash_id("hash1"), 1)
29- self.assertEqual(self.package_store.get_hash_id("hash2"), 2)
30+ self.assertEqual(self.package_store.get_hash_id(b"hash1"), 1)
31+ self.assertEqual(self.package_store.get_hash_id(b"hash2"), 2)
32
33=== modified file 'py3_ready_tests'
34--- py3_ready_tests 2017-03-30 08:01:23 +0000
35+++ py3_ready_tests 2017-03-30 08:01:23 +0000
36@@ -14,3 +14,4 @@
37 landscape.monitor.tests.test_loadaverage
38 landscape.monitor.tests.test_networkdevice
39 landscape.monitor.tests.test_networkactivity
40+landscape.monitor.tests.test_packagemonitor

Subscribers

People subscribed via source and target branches

to all changes: