def testParseCommandDeathBlossomMod(self): centurion.loadConfig(self.CONFIG_PATH) inputList = ["PCarton", "Mod", "!deathblossom"] action, user, response = centurion.parseCommand(inputList) self.assertEqual( [action, user, response], ["deathblossom", "PCarton", "Toggled deathblossom mode"])
def testParseCommandAddNormalExisting(self): centurion.loadConfig(self.CONFIG_PATH) inputList = [ "PCarton", "Normal", "!add", "!testCmdExisting Mod blah blah blah" ] action, user, response = centurion.parseCommand(inputList) self.assertEqual([action, user, response], ["none", "PCarton", ""])
def testAsSubDBCommandSub(self): centurion.loadConfig(self.CONFIG_PATH) inputList = ["PCarton", "Sub", "!testExisting3"] action, user, response = centurion.parseCommand(inputList) self.assertEqual( [action, user, response], ["respond", "PCarton", "TEST FOR EXISTING COMMAND STUFF THREE"])
def testAsFollowerDBCommandFollower(self): centurion.loadConfig(self.CONFIG_PATH) inputList = ["PCarton", "Follower", "!testExisting4"] action, user, response = centurion.parseCommand(inputList) self.assertEqual( [action, user, response], ["respond", "PCarton", "TEST FOR EXISTING COMMAND STUFF FOUR"])
def testParseCommandAddFollowerNew(self): centurion.loadConfig(self.CONFIG_PATH) inputList = [ "PCarton", "Follower", "!add", "!testCmdNew4 Mod blah blah blah" ] action, user, response = centurion.parseCommand(inputList) self.assertEqual([action, user, response], ["none", "PCarton", ""])
def testAsNormalDBCommandNormal(self): centurion.loadConfig(self.CONFIG_PATH) inputList = ["PCarton", "Normal", "!testExisting5"] action, user, response = centurion.parseCommand(inputList) self.assertEqual( [action, user, response], ["respond", "PCarton", "TEST FOR EXISTING COMMAND STUFF FIVE"])
def testParseCommandRemoveModExisting(self): centurion.loadConfig(self.CONFIG_PATH) inputList = ["PCarton", "Mod", "!remove", "!testRemoveExisting2"] action, user, response = centurion.parseCommand(inputList) self.assertEqual([action, user, response], [ "respond", "PCarton", "Command !testRemoveExisting2 successfully removed" ])
def testParseCommandAddModInvalid2(self): centurion.loadConfig(self.CONFIG_PATH) inputList = ["PCarton", "Mod", "!add", "!testCmdNew12 blah blah blah"] action, user, response = centurion.parseCommand(inputList) self.assertEqual([action, user, response], [ "respond", "PCarton", "Invalid new command. Expected Format: '!newCmd requiredRole response'" ])
def testParseCommandPermitMod(self): centurion.loadConfig(self.CONFIG_PATH) inputList = ["PCarton", "Mod", "!permit", "Garlian"] action, user, response = centurion.parseCommand(inputList) self.assertEqual([action, user, response], [ "respond", "Garlian", "User Garlian is allowed to post 1 link in the next 10 minutes" ])
def testParseCommandAddModExisting(self): centurion.loadConfig(self.CONFIG_PATH) inputList = [ "PCarton", "Mod", "!add", "!testCmdExisting Mod blah blah blah" ] action, user, response = centurion.parseCommand(inputList) self.assertEqual( [action, user, response], ["respond", "PCarton", "Error storing new command in database"])
def testParseCommandAddModNew(self): centurion.loadConfig(self.CONFIG_PATH) inputList = [ "PCarton", "Mod", "!add", "!testCmdNew2 Mod blah blah blah" ] action, user, response = centurion.parseCommand(inputList) self.assertEqual([action, user, response], [ "respond", "PCarton", "New command !testCmdNew2 successfully stored" ])
def testAsSubDBCommandMod(self): centurion.loadConfig(self.CONFIG_PATH) inputList = ["PCarton", "Sub", "!testExisting2"] action, user, response = centurion.parseCommand(inputList) self.assertEqual([action, user, response], ["none", "PCarton", ""])
def testParseCommandDeathBlossomNormal(self): centurion.loadConfig(self.CONFIG_PATH) inputList = ["PCarton", "Normal", "!deathblossom"] action, user, response = centurion.parseCommand(inputList) self.assertEqual([action, user, response], ["none", "PCarton", "Required Role not met"])
def testParseCommandRemoveModNotExisting(self): centurion.loadConfig(self.CONFIG_PATH) inputList = ["PCarton", "Mod", "!remove", "!testRemoveInvalid"] action, user, response = centurion.parseCommand(inputList) self.assertEqual([action, user, response], ["respond", "PCarton", "That command does not exist"])
def testParseCommandPermitNormalBadArgs(self): centurion.loadConfig(self.CONFIG_PATH) inputList = ["PCarton", "Normal", "!permit", "Garlian is silly"] action, user, response = centurion.parseCommand(inputList) self.assertEqual([action, user, response], ["none", "PCarton", "Required Role not met"])
def testParseCommandPermitModBadArgs(self): centurion.loadConfig(self.CONFIG_PATH) inputList = ["PCarton", "Mod", "!permit", "Garlian is silly"] action, user, response = centurion.parseCommand(inputList) self.assertEqual([action, user, response], ["none", "PCarton", "Invalid Args"])
def testParseCommandPermitFollowerNoArgs(self): centurion.loadConfig(self.CONFIG_PATH) inputList = ["PCarton", "Follower", "!permit", ""] action, user, response = centurion.parseCommand(inputList) self.assertEqual([action, user, response], ["none", "PCarton", "Required Role not met"])
def testParseCommandTimeoutSubNoArgs(self): centurion.loadConfig(self.CONFIG_PATH) inputList = ["PCarton", "Sub", "!timeout", ""] action, user, response = centurion.parseCommand(inputList) self.assertEqual([action, user, response], ["none", "PCarton", "Required Role not met"])
def testAsNormalDBCommandFollower(self): centurion.loadConfig(self.CONFIG_PATH) inputList = ["PCarton", "Normal", "!testExisting4"] action, user, response = centurion.parseCommand(inputList) self.assertEqual([action, user, response], ["none", "PCarton", ""])
def testParseCommandUnbanFollowerBadArgs(self): centurion.loadConfig(self.CONFIG_PATH) inputList = ["PCarton", "Follower", "!unban", "Garlian is silly"] action, user, response = centurion.parseCommand(inputList) self.assertEqual([action, user, response], ["none", "PCarton", "Required Role not met"])
def testParseCommandUnbanNormalNoArgs(self): centurion.loadConfig(self.CONFIG_PATH) inputList = ["PCarton", "Normal", "!unban", ""] action, user, response = centurion.parseCommand(inputList) self.assertEqual([action, user, response], ["none", "PCarton", "Required Role not met"])
def testParseCommandAddSubInvalid2(self): centurion.loadConfig(self.CONFIG_PATH) inputList = ["PCarton", "Sub", "!add", "!testCmdNew13 blah blah blah"] action, user, response = centurion.parseCommand(inputList) self.assertEqual([action, user, response], ["none", "PCarton", ""])
def testParseCommandUnbanMod(self): centurion.loadConfig(self.CONFIG_PATH) inputList = ["PCarton", "Mod", "!unban", "Garlian"] action, user, response = centurion.parseCommand(inputList) self.assertEqual([action, user, response], ["unban", "Garlian", "Unbanning user: Garlian"])
def testParseCommandBanSub(self): centurion.loadConfig(self.CONFIG_PATH) inputList = ["PCarton", "Sub", "!ban", "Garlian"] action, user, response = centurion.parseCommand(inputList) self.assertEqual([action, user, response], ["none", "PCarton", "Required Role not met"])
def testParseCommandBanCaster(self): centurion.loadConfig(self.CONFIG_PATH) inputList = ["PCarton", "Caster", "!ban", "Garlian"] action, user, response = centurion.parseCommand(inputList) self.assertEqual([action, user, response], ["ban", "Garlian", "Banning user: Garlian"])
def testParseCommandRemoveNormalNotExisting(self): centurion.loadConfig(self.CONFIG_PATH) inputList = ["PCarton", "Normal", "!remove", "!testRemoveInvalid"] action, user, response = centurion.parseCommand(inputList) self.assertEqual([action, user, response], ["none", "PCarton", ""])
def testParseCommandRemoveFollowerExisting(self): centurion.loadConfig(self.CONFIG_PATH) inputList = ["PCarton", "Follower", "!remove", "!testRemoveExisting4"] action, user, response = centurion.parseCommand(inputList) self.assertEqual([action, user, response], ["none", "PCarton", ""])
def testParseCommandTimeoutMod(self): centurion.loadConfig(self.CONFIG_PATH) inputList = ["PCarton", "Mod", "!timeout", "Garlian"] action, user, response = centurion.parseCommand(inputList) self.assertEqual([action, user, response], ["timeout", "Garlian", "Timing out user: Garlian"])
def testParseCommandUnbanModNoArgs(self): centurion.loadConfig(self.CONFIG_PATH) inputList = ["PCarton", "Mod", "!unban", ""] action, user, response = centurion.parseCommand(inputList) self.assertEqual([action, user, response], ["none", "PCarton", "Invalid Args"])
def testParseCommandPermitCasterNoArgs(self): centurion.loadConfig(self.CONFIG_PATH) inputList = ["PCarton", "Caster", "!permit", ""] action, user, response = centurion.parseCommand(inputList) self.assertEqual([action, user, response], ["none", "PCarton", "Invalid Args"])