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, {})
def test_01_get_options(self): # Can run as class options = SSHApplication.get_options() self.assertEqual(options["required"], []) self.assertEqual(options["optional"], ["user"])