def test_02_get_auth_item(self): serial = "ssh1" # create realm self.setUp_user_realms() user = User("cornelius", realm=self.realm1) # create ssh token init_token({"serial": serial, "type": "sshkey", "sshkey": SSHKEY}, user=user) auth_item = SSHApplication.get_authentication_item("sshkey", serial) self.assertEqual(auth_item.get("sshkey"), SSHKEY) self.assertEqual(auth_item.get("username"), "cornelius")
def test_03_get_auth_item_unsupported(self): # unsupported token type auth_item = SSHApplication.get_authentication_item("unsupported", "s") self.assertEqual(auth_item, {})