← Back to team overview

launchpad-reviewers team mailing list archive

Re: [Merge] lp:~wgrant/launchpad/getFullKeyText-crash into lp:launchpad

 

Review: Approve



Diff comments:

> 
> === modified file 'lib/lp/registry/tests/test_ssh.py'
> --- lib/lp/registry/tests/test_ssh.py	2018-07-02 14:08:22 +0000
> +++ lib/lp/registry/tests/test_ssh.py	2018-11-07 04:11:23 +0000
> @@ -62,6 +63,18 @@
>          expected = "ecdsa-sha2-nistp521 %s %s" % (key.keytext, key.comment)
>          self.assertEqual(expected, key.getFullKeyText())
>  
> +    def test_getFullKeyText_for_corrupt_key(self):
> +	# If the key text is corrupt, the type from the database is used
> +	# instead of the one decoded from the text.

Weird comment indentation here.

> +        person = self.factory.makePerson()
> +        with person_logged_in(person):
> +            key = self.factory.makeSSHKey(person, "ssh-rsa")
> +	    # The base64 has a valid netstring, but the contents are garbage so
> +	    # can't be a valid key type.

... and here.

> +            removeSecurityProxy(key).keytext = 'AAAAB3NzaC1012EAAAA='
> +        expected = "ssh-rsa %s %s" % (key.keytext, key.comment)
> +        self.assertEqual(expected, key.getFullKeyText())
> +
>      def test_destroySelf_sends_notification_by_default(self):
>          person = self.factory.makePerson()
>          with person_logged_in(person):


-- 
https://code.launchpad.net/~wgrant/launchpad/getFullKeyText-crash/+merge/358417
Your team Launchpad code reviewers is subscribed to branch lp:launchpad.


References