← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~cjwatson/launchpad:py3-test-ociregistrycredentials-json into launchpad:master

 

Colin Watson has proposed merging ~cjwatson/launchpad:py3-test-ociregistrycredentials-json into launchpad:master.

Commit message:
Pass text to json.loads in TestOCIRegistryCredentials

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/393777
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/launchpad:py3-test-ociregistrycredentials-json into launchpad:master.
diff --git a/lib/lp/oci/tests/test_ociregistrycredentials.py b/lib/lp/oci/tests/test_ociregistrycredentials.py
index c0e9ba1..5f43d60 100644
--- a/lib/lp/oci/tests/test_ociregistrycredentials.py
+++ b/lib/lp/oci/tests/test_ociregistrycredentials.py
@@ -56,7 +56,8 @@ class TestOCIRegistryCredentials(OCIConfigHelperMixin, TestCaseWithFactory):
         self.assertThat(oci_credentials._credentials, MatchesDict({
             "username": Equals("foo"),
             "credentials_encrypted": AfterPreprocessing(
-                lambda value: json.loads(container.decrypt(value)),
+                lambda value: json.loads(
+                    container.decrypt(value).decode("UTF-8")),
                 Equals({"password": "bar"})),
             }))
 
@@ -93,7 +94,8 @@ class TestOCIRegistryCredentials(OCIConfigHelperMixin, TestCaseWithFactory):
             self.assertThat(oci_credentials._credentials, MatchesDict({
                 "username": Equals("test"),
                 "credentials_encrypted": AfterPreprocessing(
-                    lambda value: json.loads(container.decrypt(value)),
+                    lambda value: json.loads(
+                        container.decrypt(value).decode("UTF-8")),
                     Equals({})),
                 }))
 
@@ -108,7 +110,8 @@ class TestOCIRegistryCredentials(OCIConfigHelperMixin, TestCaseWithFactory):
         with person_logged_in(owner):
             self.assertThat(oci_credentials._credentials, MatchesDict({
                 "credentials_encrypted": AfterPreprocessing(
-                    lambda value: json.loads(container.decrypt(value)),
+                    lambda value: json.loads(
+                        container.decrypt(value).decode("UTF-8")),
                     Equals({"password": "bar"}))}))
 
     def test_credentials_set_encrypts_other_data(self):
@@ -124,7 +127,8 @@ class TestOCIRegistryCredentials(OCIConfigHelperMixin, TestCaseWithFactory):
             self.assertThat(oci_credentials._credentials, MatchesDict({
                 "username": Equals("foo"),
                 "credentials_encrypted": AfterPreprocessing(
-                    lambda value: json.loads(container.decrypt(value)),
+                    lambda value: json.loads(
+                        container.decrypt(value).decode("UTF-8")),
                     Equals({"password": "bar", "other": "baz"}))}))