コード例 #1
0
ファイル: test_commands.py プロジェクト: tai271828/maas
 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))
コード例 #2
0
ファイル: test_commands.py プロジェクト: tai271828/maas
 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),
     )