Merge lp:~cjwatson/lazr.restful/py3-test-etag into lp:lazr.restful

Proposed by Colin Watson
Status: Merged
Merged at revision: 282
Proposed branch: lp:~cjwatson/lazr.restful/py3-test-etag
Merge into: lp:lazr.restful
Diff against target: 41 lines (+5/-5)
1 file modified
src/lazr/restful/tests/test_etag.py (+5/-5)
To merge this branch: bzr merge lp:~cjwatson/lazr.restful/py3-test-etag
Reviewer Review Type Date Requested Status
Thiago F. Pappacena (community) Approve
Review via email: mp+396620@code.launchpad.net

Commit message

Fix lazr.restful.tests.test_etag for Python 3.

To post a comment you must log in.
Revision history for this message
Thiago F. Pappacena (pappacena) wrote :

LGTM

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/lazr/restful/tests/test_etag.py'
2--- src/lazr/restful/tests/test_etag.py 2020-05-12 11:57:28 +0000
3+++ src/lazr/restful/tests/test_etag.py 2021-01-20 23:48:26 +0000
4@@ -29,7 +29,7 @@
5 def test_no_field_details(self):
6 # If make_entry_etag_cores is given no field details (because no
7 # fields exist), the resulting cores empty strings.
8- self.assertEqual(make_entry_etag_cores([]), ['', ''])
9+ self.assertEqual(make_entry_etag_cores([]), [b'', b''])
10
11 def test_writable_fields(self):
12 # If there are writable fields, their values are incorporated into the
13@@ -43,7 +43,7 @@
14 'value': 'second'}),
15 ]
16 self.assertEqual(
17- make_entry_etag_cores(field_details), ['', 'first\0second'])
18+ make_entry_etag_cores(field_details), [b'', b'first\0second'])
19
20 def test_unchanging_fields(self):
21 # If there are fields that are not writable their values are still
22@@ -56,7 +56,7 @@
23 ]
24 self.assertEqual(
25 make_entry_etag_cores(field_details),
26- ['the value', ''])
27+ [b'the value', b''])
28
29 def test_combinations_of_fields(self):
30 # If there are a combination of writable, changable, and unchanable
31@@ -77,8 +77,8 @@
32 ]
33 self.assertEqual(
34 make_entry_etag_cores(field_details),
35- ['first-not-writable\x00second-not-writable',
36- 'first-writable\x00second-writable'])
37+ [b'first-not-writable\x00second-not-writable',
38+ b'first-writable\x00second-writable'])
39
40
41 class TestHTTPResourceETags(unittest.TestCase):

Subscribers

People subscribed via source and target branches