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

Proposed by Steffen Allner
Status: Merged
Approved by: Eric Snow
Approved revision: 999
Merged at revision: 996
Proposed branch: lp:~gocept/landscape-client/py3-monitor-processorinfo
Merge into: lp:~landscape/landscape-client/trunk
Prerequisite: lp:~gocept/landscape-client/py3-monitor-aptpreferences
Diff against target: 21 lines (+2/-1)
2 files modified
landscape/monitor/tests/test_processorinfo.py (+1/-1)
py3_ready_tests (+1/-0)
To merge this branch: bzr merge lp:~gocept/landscape-client/py3-monitor-processorinfo
Reviewer Review Type Date Requested Status
Eric Snow (community) Abstain
Daniel Havlik (community) Approve
Adam Collard (community) Approve
🤖 Landscape Builder test results Approve
Review via email: mp+321424@code.launchpad.net

Commit message

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

It fixes a problem with comparision between int and list.

Description of the change

This MP fixes a test for landscape.monito.processorinfo, which broke because a comparison of list and int is not defined in Python 3.

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: 999
Branch: lp:~gocept/landscape-client/py3-monitor-processorinfo
Jenkins: https://ci.lscape.net/job/latch-test-xenial/3822/

review: Approve (test results)
Revision history for this message
Adam Collard (adam-collard) :
review: Approve
Revision history for this message
Daniel Havlik (nilo) wrote :

+len([1])

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

LGTM

It's possible that this was an invalid test that we didn't notice under Py2. Perhaps message["processors"] used to be an int? Regardless, the test is correct now.

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

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'landscape/monitor/tests/test_processorinfo.py'
2--- landscape/monitor/tests/test_processorinfo.py 2016-06-15 20:57:55 +0000
3+++ landscape/monitor/tests/test_processorinfo.py 2017-03-30 08:57:38 +0000
4@@ -21,7 +21,7 @@
5 """Ensure the plugin can parse /proc/cpuinfo."""
6 message = ProcessorInfo().create_message()
7 self.assertEqual(message["type"], "processor-info")
8- self.assertTrue(message["processors"] > 0)
9+ self.assertTrue(len(message["processors"]) > 0)
10
11 for processor in message["processors"]:
12 self.assertTrue("processor-id" in processor)
13
14=== modified file 'py3_ready_tests'
15--- py3_ready_tests 2017-03-30 08:57:38 +0000
16+++ py3_ready_tests 2017-03-30 08:57:38 +0000
17@@ -16,3 +16,4 @@
18 landscape.monitor.tests.test_networkactivity
19 landscape.monitor.tests.test_packagemonitor
20 landscape.monitor.tests.test_aptpreferences
21+landscape.monitor.tests.test_processorinfo

Subscribers

People subscribed via source and target branches

to all changes: