# Path: chromabot/utils.py
# def base36decode(number):
# def extract_command(text):
# def forcelist(item):
# def name_to_id(name):
# def now():
# def num_to_team(number, config=None):
# def pairwise(iterable):
# def team_to_num(team):
# def timestr(secs=None):
# def version(config):
# 
# Path: chromabot/parser.py
# def parse(s):
#     result = root.parseString(s)
#     return result[0]


import unittest
from chromabot import utils
from chromabot.commands import *
from chromabot.parser import parse

    def testMixedCasePromote(self):
        src = 'promote HurfenDurf'
        parsed = parse(src)
        self.assertIsInstance(parsed, PromoteCommand)
        self.assertEqual(parsed.who, "HurfenDurf")
        self.assertEqual(parsed.direction, 1)

    def testDemoteCommand(self):
        src = "demote hurfendurf"
        parsed = parse(src)
        self.assertIsInstance(parsed, PromoteCommand)
        self.assertEqual(parsed.who, "hurfendurf")
        self.assertEqual(parsed.direction, 0)

    def testMixedCaseDemote(self):
        src = "demote HurfenDurf"
        parsed = parse(src)
        self.assertIsInstance(parsed, PromoteCommand)
        self.assertEqual(parsed.who, "HurfenDurf")
        self.assertEqual(parsed.direction, 0)


class TestCommandExtraction(unittest.TestCase):

    def goodparse(self, text):
        cmd = extract_single_command(text)
        self.assertEqual("status", cmd)

    def badparse(self, text):

# Path: chromabot/utils.py
# def base36decode(number):
# def extract_command(text):
# def forcelist(item):
# def name_to_id(name):
# def now():
# def num_to_team(number, config=None):
# def pairwise(iterable):
# def team_to_num(team):
# def timestr(secs=None):
# def version(config):
# 
# Path: chromabot/parser.py
# def parse(s):
#     result = root.parseString(s)
#     return result[0]


# Path: chromabot/tests/parsetest.py
import unittest
from chromabot import utils
from chromabot.commands import *
from chromabot.parser import parse


    def testMixedCasePromote(self):
        src = 'promote HurfenDurf'
        parsed = parse(src)
        self.assertIsInstance(parsed, PromoteCommand)
        self.assertEqual(parsed.who, "HurfenDurf")
        self.assertEqual(parsed.direction, 1)

    def testDemoteCommand(self):
        src = "demote hurfendurf"
        parsed = parse(src)
        self.assertIsInstance(parsed, PromoteCommand)
        self.assertEqual(parsed.who, "hurfendurf")
        self.assertEqual(parsed.direction, 0)

    def testMixedCaseDemote(self):
        src = "demote HurfenDurf"
        parsed = parse(src)
        self.assertIsInstance(parsed, PromoteCommand)
        self.assertEqual(parsed.who, "HurfenDurf")
        self.assertEqual(parsed.direction, 0)


class TestCommandExtraction(unittest.TestCase):

    def goodparse(self, text):
        cmd = extract_single_command(text)
        self.assertEqual("status", cmd)

    def badparse(self, text):

        cmd = utils.extract_command(text)