def setUp(self): super(Test_cmd_pagear, self).setUp() self.conf = CfgConfigParser() self.conf.loadFromString(""" [commands] pagear-gear: 20 """) self.p = PoweradminurtPlugin(self.console, self.conf) when(self.console).getCvar('timelimit').thenReturn(Cvar('timelimit', value=20)) when(self.console).getCvar('g_maxGameClients').thenReturn(Cvar('g_maxGameClients', value=16)) when(self.console).getCvar('sv_maxclients').thenReturn(Cvar('sv_maxclients', value=16)) when(self.console).getCvar('sv_privateClients').thenReturn(Cvar('sv_privateClients', value=0)) when(self.console).getCvar('g_allowvote').thenReturn(Cvar('g_allowvote', value=0)) when(self.console).getCvar('g_modversion').thenReturn(Cvar('g_modversion', value="4.2.018")) self.given_forbidden_weapon_are(G_NONE) self.p.onLoadConfig() self.p.onStartup() self.sleep_patcher = patch.object(time, 'sleep') self.sleep_patcher.start() self.setCvar_patcher = patch.object(self.console, 'setCvar') self.setCvar_mock = self.setCvar_patcher.start() self.superadmin.connects("2")
def setUp(self): super(Test_headshotcounter, self).setUp() self.conf = CfgConfigParser() self.conf.loadFromString(""" [headshotcounter] # enable the headshot counter? hs_enable: True # reset counts? Options: no / map / round reset_vars: no # set broadcast to True if you want the counter to appear in the upper left, False is in chatarea broadcast: True # Announce every single headshot? announce_all: True # Announce percentages (after 5 headshots) announce_percentages: True # Only show percentages larger than next threshold percent_min: 10 # Advise victims to wear a helmet? warn_helmet: True # After how many headshots? warn_helmet_nr: 7 # Advise victims to wear kevlar? warn_kevlar: True # After how many torso hits? warn_kevlar_nr: 50 """) self.p = PoweradminurtPlugin(self.console, self.conf) self.init_default_cvar() self.p.onLoadConfig() self.p.onStartup() self.console.say = Mock() self.console.write = Mock()
def setUp(self): super(Test_cmd_ident, self).setUp() self.conf = CfgConfigParser() self.conf.loadFromString(""" [commands] paident-id: 20 [special] paident_full_level: 40 """) self.p = PoweradminurtPlugin(self.console, self.conf) self.init_default_cvar() self.parser_conf._settings.update( {'b3': { "time_zone": "GMT", "time_format": "%I:%M%p %Z %m/%d/%y" }}) self.p.onLoadConfig() self.p.onStartup() self.console.say = Mock() self.console.write = Mock() self.moderator.connects("2") self.moderator.message_history = []
def setUp(self): super(mixin_conf, self).setUp() self.conf = CfgConfigParser() self.p = PoweradminurtPlugin(self.console, self.conf) self.init_default_cvar() logger = logging.getLogger('output') logger.setLevel(logging.INFO)
def setUp(self): super(Test_cmd_captain, self).setUp() self.conf = CfgConfigParser() self.conf.loadFromString(""" [commands] pacaptain-captain: 40 ; set the the given client as the captain for its team """) self.p = PoweradminurtPlugin(self.console, self.conf) self.init_default_cvar() self.p.onLoadConfig() self.p.onStartup() self.console.say = Mock() self.console.write = Mock() self.admin.connects("2") self.moderator.connects("3")
def setUp(self): super(Test_cmd_swap, self).setUp() self.conf = CfgConfigParser() self.conf.loadFromString(""" [commands] paswap-swap: 20 """) self.p = PoweradminurtPlugin(self.console, self.conf) self.init_default_cvar() self.p.onLoadConfig() self.p.onStartup() self.console.say = Mock() self.console.write = Mock() self.admin.connects("2") self.moderator.connects("3")
def setUp(self): super(Test_cmd_goto, self).setUp() self.conf = CfgConfigParser() self.conf.loadFromString(""" [commands] paskins-skins: 20 ; set the use of client skins <on/off> """) self.p = PoweradminurtPlugin(self.console, self.conf) self.init_default_cvar() self.p.onLoadConfig() self.p.onStartup() self.console.say = Mock() self.console.write = Mock() self.moderator.connects("2")
def setUp(self): super(Test_cmd_jump, self).setUp() self.conf = CfgConfigParser() self.conf.loadFromString(""" [commands] pajump-jump: 20 ; change game type to Jump """) self.p = PoweradminurtPlugin(self.console, self.conf) self.init_default_cvar() self.p.onLoadConfig() self.p.onStartup() self.console.say = Mock() self.console.write = Mock() self.moderator.connects("2")
def setUp(self): super(Test_cmd_funstuff, self).setUp() self.conf = CfgConfigParser() self.conf.loadFromString(""" [commands] pastamina-stamina: 20 ; set the stamina behavior <default/regain/infinite> """) self.p = PoweradminurtPlugin(self.console, self.conf) self.init_default_cvar() self.p.onLoadConfig() self.p.onStartup() self.console.say = Mock() self.console.write = Mock() self.moderator.connects("2")
def setUp(self): super(mixin_cmd_paset, self).setUp() self.conf = CfgConfigParser() self.conf.loadFromString(""" [commands] paset: 20 """) self.p = PoweradminurtPlugin(self.console, self.conf) self.init_default_cvar() self.p.onLoadConfig() self.p.onStartup() self.sleep_patcher = patch.object(time, 'sleep') self.sleep_patcher.start() self.setCvar_patcher = patch.object(self.console, 'setCvar') self.setCvar_mock = self.setCvar_patcher.start() self.moderator.connects("2")
def setUp(self): super(mixin_cmd_pasetnextmap, self).setUp() self.conf = CfgConfigParser() self.conf.loadFromString(""" [commands] pasetnextmap-snmap: 20 """) self.p = PoweradminurtPlugin(self.console, self.conf) self.init_default_cvar() self.p.onLoadConfig() self.p.onStartup() self.sleep_patcher = patch.object(time, 'sleep') self.sleep_patcher.start() self.console.say = Mock() self.console.saybig = Mock() self.console.write = Mock() self.moderator.connects("2")
def setUp(self): super(mixin_name_checker, self).setUp() self.conf = CfgConfigParser() self.conf.loadFromString(""" [namechecker] checkdupes: True checkunknown: True checkbadnames: True """) self.p = PoweradminurtPlugin(self.console, self.conf) self.init_default_cvar() self.p.onLoadConfig() self.p.onStartup() self.sleep_patcher = patch.object(time, 'sleep') self.sleep_patcher.start() self.console.say = Mock() self.console.write = Mock() self.p._ignoreTill = 0