Esempio n. 1
0
 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"])
Esempio n. 2
0
 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", ""])
Esempio n. 3
0
 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"])
Esempio n. 4
0
 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"])
Esempio n. 5
0
 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", ""])
Esempio n. 6
0
 def testRetrievListMod(self):
     centurion.loadConfig(self.CONFIG_PATH)
     inputList = ["Mod"]
     commands = centurion.retrieveList(inputList)
     self.assertEqual(
         commands,
         ["!testCmdExisting", "!testRemoveExisting2", "!testExisting2"])
Esempio n. 7
0
 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"])
Esempio n. 8
0
 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"
     ])
Esempio n. 9
0
 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'"
     ])
Esempio n. 10
0
 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"
     ])
Esempio n. 11
0
 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"])
Esempio n. 12
0
 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"
     ])
Esempio n. 13
0
 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"])
Esempio n. 14
0
 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", ""])
Esempio n. 15
0
 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"])
Esempio n. 16
0
 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"])
Esempio n. 17
0
 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"])
Esempio n. 18
0
 def testRetrievListFollower(self):
     centurion.loadConfig(self.CONFIG_PATH)
     inputList = ["Follower"]
     commands = centurion.retrieveList(inputList)
     self.assertEqual(commands, ["!testRemoveExisting4", "!testExisting4"])
Esempio n. 19
0
 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"])
Esempio n. 20
0
 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"])
Esempio n. 21
0
 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"])
Esempio n. 22
0
 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"])
Esempio n. 23
0
 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"])
Esempio n. 24
0
 def testLoadConfigDebug(self):
     centurion.loadConfig(self.CONFIG_PATH)
     self.assertEqual(centurion.debug, False)
Esempio n. 25
0
 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", ""])
Esempio n. 26
0
 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"])
Esempio n. 27
0
 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"])
Esempio n. 28
0
 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"])
Esempio n. 29
0
 def testRetrievListNormal(self):
     centurion.loadConfig(self.CONFIG_PATH)
     inputList = ["Normal"]
     commands = centurion.retrieveList(inputList)
     self.assertEqual(commands, ["!testRemoveExisting5", "!testExisting5"])
Esempio n. 30
0
 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"])