def test_tempban_non_existing_player(self):
        joe = FakeClient(Admin_functional_test.fakeConsole, name="Joe", exactName="Joe", guid="joeguid", groupBits=128, team=b3.TEAM_RED)
        mike = FakeClient(Admin_functional_test.fakeConsole, name="Mike", exactName="Mike", guid="mikeguid", groupBits=1, team=b3.TEAM_BLUE)

        joe.message = Mock()
        joe.connects(0)
        mike.connects(1)

        joe.says('!tempban foo 5h')
        joe.message.assert_called_with('^7No players found matching foo')
    def test_tempban_no_duration(self):
        joe = FakeClient(Admin_functional_test.fakeConsole, name="Joe", exactName="Joe", guid="joeguid", groupBits=128, team=b3.TEAM_RED)
        mike = FakeClient(Admin_functional_test.fakeConsole, name="Mike", exactName="Mike", guid="mikeguid", groupBits=1, team=b3.TEAM_BLUE)

        joe.message = Mock()
        joe.connects(0)
        mike.connects(1)

        joe.says('!tempban mike')
        joe.message.assert_called_with('^7Invalid parameters')
    def test_tempban_no_reason(self):
        joe = FakeClient(Admin_functional_test.fakeConsole, name="Joe", exactName="Joe", guid="joeguid", groupBits=128, team=b3.TEAM_RED)
        mike = FakeClient(Admin_functional_test.fakeConsole, name="Mike", exactName="Mike", guid="mikeguid", groupBits=1, team=b3.TEAM_BLUE)

        joe.message = Mock()
        joe.connects(0)
        mike.connects(1)
        mike.tempban = Mock()

        joe.says('!tempban mike 5h')
        mike.tempban.assert_called_with('', None, 5*60, joe)
    def test_tempban_non_existing_player(self):
        joe = FakeClient(Admin_functional_test.fakeConsole,
                         name="Joe",
                         exactName="Joe",
                         guid="joeguid",
                         groupBits=128,
                         team=b3.TEAM_RED)
        mike = FakeClient(Admin_functional_test.fakeConsole,
                          name="Mike",
                          exactName="Mike",
                          guid="mikeguid",
                          groupBits=1,
                          team=b3.TEAM_BLUE)

        joe.message = Mock()
        joe.connects(0)
        mike.connects(1)

        joe.says('!tempban foo 5h')
        joe.message.assert_called_with('^7No players found matching foo')
    def test_tempban_no_duration(self):
        joe = FakeClient(Admin_functional_test.fakeConsole,
                         name="Joe",
                         exactName="Joe",
                         guid="joeguid",
                         groupBits=128,
                         team=b3.TEAM_RED)
        mike = FakeClient(Admin_functional_test.fakeConsole,
                          name="Mike",
                          exactName="Mike",
                          guid="mikeguid",
                          groupBits=1,
                          team=b3.TEAM_BLUE)

        joe.message = Mock()
        joe.connects(0)
        mike.connects(1)

        joe.says('!tempban mike')
        joe.message.assert_called_with('^7Invalid parameters')
    def test_tempban_no_reason(self):
        joe = FakeClient(Admin_functional_test.fakeConsole,
                         name="Joe",
                         exactName="Joe",
                         guid="joeguid",
                         groupBits=128,
                         team=b3.TEAM_RED)
        mike = FakeClient(Admin_functional_test.fakeConsole,
                          name="Mike",
                          exactName="Mike",
                          guid="mikeguid",
                          groupBits=1,
                          team=b3.TEAM_BLUE)

        joe.message = Mock()
        joe.connects(0)
        mike.connects(1)
        mike.tempban = Mock()

        joe.says('!tempban mike 5h')
        mike.tempban.assert_called_with('', None, 5 * 60, joe)