Example #1
0
 def test_validate_ssh_import_validates_protocol_and_user_id(self):
     protocol = random.choice(
         [KEYS_PROTOCOL_TYPE.LP, KEYS_PROTOCOL_TYPE.GH])
     user_id = factory.make_name("user-id")
     ssh_import = "%s:%s" % (protocol, user_id)
     self.assertEqual((protocol, user_id),
                      createadmin.validate_ssh_import(ssh_import))
Example #2
0
 def test_validate_ssh_import_validates_user_id_with_no_protocol(self):
     user_id = factory.make_name("user-id")
     self.assertEqual(
         (KEYS_PROTOCOL_TYPE.LP, user_id),
         createadmin.validate_ssh_import(user_id),
     )