← Back to team overview

launchpad-reviewers team mailing list archive

Re: [Merge] lp:~thomir/launchpad/devel-fix-gpg-import into lp:launchpad

 

Review: Approve code



Diff comments:

> === modified file 'lib/lp/registry/browser/tests/test_gpgkey.py'
> --- lib/lp/registry/browser/tests/test_gpgkey.py	2016-03-21 05:37:40 +0000
> +++ lib/lp/registry/browser/tests/test_gpgkey.py	2016-07-24 23:44:40 +0000
> @@ -166,6 +171,38 @@
>          inactive_keys = keyset.getGPGKeysForPerson(person, active=False)
>          self.assertThat(inactive_keys, HasLength(0))
>  
> +    def set_config_parameters(self, **kwargs):
> +        config_name = self.getUniqueString()
> +        config_fixture = self.useFixture(
> +            ConfigFixture(
> +                config_name,
> +                LaunchpadFunctionalLayer.config_fixture.instance_name))
> +        setting_lines = ['[launchpad]'] + \
> +            ['%s: %s' % (k, v) for k, v in kwargs.items()]
> +        config_fixture.add_section('\n'.join(setting_lines))
> +        self.useFixture(ConfigUseFixture(config_name))
> +
> +    def test_getOwnerIdForPerson_uses_canonical_url(self):
> +        keyset = getUtility(IGPGKeySet)
> +        email = 'foo@xxxxxxx'
> +        person = self.factory.makePerson(email)
> +        openid_canonical_root = self.getUniqueString()
> +        self.set_config_parameters(openid_canonical_root=openid_canonical_root)
> +
> +        self.assertThat(
> +            keyset.getOwnerIdForPerson(person),
> +            StartsWith(openid_canonical_root))
> +
> +    def test_getAllOwnerIdsForPerson_uses_canonical_url(self):
> +        keyset = getUtility(IGPGKeySet)
> +        email = 'foo@xxxxxxx'
> +        person = self.factory.makePerson(email)
> +        openid_canonical_root = self.getUniqueString()
> +        self.set_config_parameters(openid_canonical_root=openid_canonical_root)
> +
> +        for id in keyset.getAllOwnerIdsForPerson(person):
> +            self.assertThat(id, StartsWith(openid_canonical_root))
> +

These tests are of the model, but are in lp.registry.browser.tests. Can you move them to lp.registry.tests.test_gpgkey instead (it doesn't currently exist; yay doctests)?

>  
>  class GPGKeySetWithGPGServiceTests(GPGKeySetTests):
>  


-- 
https://code.launchpad.net/~thomir/launchpad/devel-fix-gpg-import/+merge/300830
Your team Launchpad code reviewers is subscribed to branch lp:launchpad.


References