<commit_before>from twisted.trial import unittest

from peloid.app.mud import room


class TestRoom(room.Room):
    """
    You enter a dark room. You can see light between the planks comprising the
    floor. The air completely lacks in movement, seems half comprised of
    suspended dust, and smells of deep must. Whether or not it was intended
    originally, you can draw only one conclusion: this is now a test room.
    """
    onEnterText = "A creaking door closes behind you."
    onExitText = "You breath deeply; the test room has passed."
    exits = ["W", "N", "E"]

    def __init__(self):
        self.testState = []

    def onOpenDoor(self):
        self.testState.append("door opened")

    def onPassThreshold(self):
        self.testState.append("passed through door")

    def onEnter(self):
        self.testState.append("entered room")

    def onExit(self):
        self.testState.append("exited room")


class RoomTestCase(unittest.TestCase):
    """
    """
    def setUp(self):
        self.room = TestRoom()

    def test_getDesc(self):
        self.assertTrue(self.room.getDesc().startswith("\n\t"))
        self.assertTrue(self.room.getDesc().endswith("\n\t"))
        self.assertEqual(len(self.room.getDesc()), 293)

    def test_getDescEnter(self):
        self.assertEqual(
            self.room.getDescEnter(),
            "A creaking door closes behind you.")

    def test_getDescExit(self):
        self.assertEqual(
            self.room.getDescExit(),
            "You breath deeply; the test room has passed.")

    def test_getExitsText(self):
        self.assertEqual(
            self.room.getExitsText(),
            "This room has the following exits: W, N, and E.")

    def test_enter(self):<commit_msg>Fixed test after replacing tabs with spaces.<commit_after>from twisted.trial import unittest

from peloid.app.mud import room


class TestRoom(room.Room):
    """
    You enter a dark room. You can see light between the planks comprising the
    floor. The air completely lacks in movement, seems half comprised of
    suspended dust, and smells of deep must. Whether or not it was intended
    originally, you can draw only one conclusion: this is now a test room.
    """
    onEnterText = "A creaking door closes behind you."
    onExitText = "You breath deeply; the test room has passed."
    exits = ["W", "N", "E"]

    def __init__(self):
        self.testState = []

    def onOpenDoor(self):
        self.testState.append("door opened")

    def onPassThreshold(self):
        self.testState.append("passed through door")

    def onEnter(self):
        self.testState.append("entered room")

    def onExit(self):
        self.testState.append("exited room")


class RoomTestCase(unittest.TestCase):
    """
    """
    def setUp(self):
        self.room = TestRoom()

    def test_getDesc(self):
        self.assertTrue(self.room.getDesc().startswith("\n    "))
        self.assertTrue(self.room.getDesc().endswith("\n    "))
        self.assertEqual(len(self.room.getDesc()), 308)

    def test_getDescEnter(self):
        self.assertEqual(
            self.room.getDescEnter(),
            "A creaking door closes behind you.")

    def test_getDescExit(self):
        self.assertEqual(
            self.room.getDescExit(),
            "You breath deeply; the test room has passed.")

    def test_getExitsText(self):
        self.assertEqual(
            self.room.getExitsText(),
            "This room has the following exits: W, N, and E.")

    def test_enter(self):
{'fraction_non_alphanumeric': 0.10953863572035098, 'fraction_numerical': 0.0016982734220209455, 'mean_word_length': 2.6358024691358026, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5608549', 'n_tokens_mistral': 1050, 'n_tokens_neox': 996, 'n_words': 307}