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
=== modified file 'src/lazr/restful/tests/test_etag.py'
--- src/lazr/restful/tests/test_etag.py 2020-05-12 11:57:28 +0000
+++ src/lazr/restful/tests/test_etag.py 2021-01-20 23:48:26 +0000
@@ -29,7 +29,7 @@
29 def test_no_field_details(self):29 def test_no_field_details(self):
30 # If make_entry_etag_cores is given no field details (because no30 # If make_entry_etag_cores is given no field details (because no
31 # fields exist), the resulting cores empty strings.31 # fields exist), the resulting cores empty strings.
32 self.assertEqual(make_entry_etag_cores([]), ['', ''])32 self.assertEqual(make_entry_etag_cores([]), [b'', b''])
3333
34 def test_writable_fields(self):34 def test_writable_fields(self):
35 # If there are writable fields, their values are incorporated into the35 # If there are writable fields, their values are incorporated into the
@@ -43,7 +43,7 @@
43 'value': 'second'}),43 'value': 'second'}),
44 ]44 ]
45 self.assertEqual(45 self.assertEqual(
46 make_entry_etag_cores(field_details), ['', 'first\0second'])46 make_entry_etag_cores(field_details), [b'', b'first\0second'])
4747
48 def test_unchanging_fields(self):48 def test_unchanging_fields(self):
49 # If there are fields that are not writable their values are still49 # If there are fields that are not writable their values are still
@@ -56,7 +56,7 @@
56 ]56 ]
57 self.assertEqual(57 self.assertEqual(
58 make_entry_etag_cores(field_details),58 make_entry_etag_cores(field_details),
59 ['the value', ''])59 [b'the value', b''])
6060
61 def test_combinations_of_fields(self):61 def test_combinations_of_fields(self):
62 # If there are a combination of writable, changable, and unchanable62 # If there are a combination of writable, changable, and unchanable
@@ -77,8 +77,8 @@
77 ]77 ]
78 self.assertEqual(78 self.assertEqual(
79 make_entry_etag_cores(field_details),79 make_entry_etag_cores(field_details),
80 ['first-not-writable\x00second-not-writable',80 [b'first-not-writable\x00second-not-writable',
81 'first-writable\x00second-writable'])81 b'first-writable\x00second-writable'])
8282
8383
84class TestHTTPResourceETags(unittest.TestCase):84class TestHTTPResourceETags(unittest.TestCase):

Subscribers

People subscribed via source and target branches