Merge lp:~gocept/landscape-client/py3-package-taskhandler into lp:~landscape/landscape-client/trunk

Proposed by Steffen Allner
Status: Merged
Approved by: Данило Шеган
Approved revision: 988
Merged at revision: 966
Proposed branch: lp:~gocept/landscape-client/py3-package-taskhandler
Merge into: lp:~landscape/landscape-client/trunk
Prerequisite: lp:~gocept/landscape-client/py3-package-store-reporter
Diff against target: 39 lines (+5/-3)
2 files modified
landscape/package/tests/test_taskhandler.py (+3/-3)
py3_ready_tests (+2/-0)
To merge this branch: bzr merge lp:~gocept/landscape-client/py3-package-taskhandler
Reviewer Review Type Date Requested Status
Данило Шеган (community) Approve
Daniel Havlik (community) Approve
🤖 Landscape Builder test results Approve
Review via email: mp+320597@code.launchpad.net

Commit message

Update landscape.package.taskhandler tests to work with py3 too.

Description of the change

THis MP considers the tests for landscape.package.taskhandler, which did not work with Python 3 as we need hashes to be bytes explicitly.

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 check
Result: Success
Revno: 988
Branch: lp:~gocept/landscape-client/py3-package-taskhandler
Jenkins: https://ci.lscape.net/job/latch-test-xenial/3693/

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

+1

review: Approve
Revision history for this message
Данило Шеган (danilo) wrote :

Looks good.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'landscape/package/tests/test_taskhandler.py'
2--- landscape/package/tests/test_taskhandler.py 2017-01-09 14:29:54 +0000
3+++ landscape/package/tests/test_taskhandler.py 2017-03-22 08:27:07 +0000
4@@ -48,14 +48,14 @@
5 def test_use_hash_id_db(self):
6
7 # We don't have this hash=>id mapping
8- self.assertEqual(self.store.get_hash_id("hash"), None)
9+ self.assertEqual(self.store.get_hash_id(b"hash"), None)
10
11 # An appropriate hash=>id database is available
12 self.config.data_path = self.makeDir()
13 os.makedirs(os.path.join(self.config.data_path, "package", "hash-id"))
14 hash_id_db_filename = os.path.join(self.config.data_path, "package",
15 "hash-id", "uuid_codename_arch")
16- HashIdStore(hash_id_db_filename).set_hash_ids({"hash": 123})
17+ HashIdStore(hash_id_db_filename).set_hash_ids({b"hash": 123})
18
19 # Fake uuid, codename and arch
20 message_store = self.broker_service.message_store
21@@ -68,7 +68,7 @@
22
23 # Now we do have the hash=>id mapping
24 def callback(ignored):
25- self.assertEqual(self.store.get_hash_id("hash"), 123)
26+ self.assertEqual(self.store.get_hash_id(b"hash"), 123)
27 result.addCallback(callback)
28
29 return result
30
31=== modified file 'py3_ready_tests'
32--- py3_ready_tests 2017-03-22 08:27:07 +0000
33+++ py3_ready_tests 2017-03-22 08:27:07 +0000
34@@ -3,3 +3,5 @@
35 landscape.package.tests.test_store
36 landscape.package.tests.test_reporter
37
38+landscape.package.tests.test_taskhandler
39+

Subscribers

People subscribed via source and target branches

to all changes: