コード例 #1
0
ファイル: test_building.py プロジェクト: rlazarus/MUSS
 def test_create_types(self):
     self.assert_response("create muss.db.Container box", endswith=", box.")
     box = db.find(lambda x: x.name == "box")
     self.assertIsInstance(box, db.Container)
     self.assertEqual(box.location, self.player)
     self.assert_response("create muss.equipment.Equipment snake",
                          endswith=", snake.")
     snake = db.find(lambda x: x.name == "snake")
     self.assertIsInstance(snake, equipment.Equipment)
     self.assertEqual(snake.location, self.player)
コード例 #2
0
ファイル: test_building.py プロジェクト: mongolsamurai/MUSS
 def test_create_types(self):
     self.assert_response("create muss.db.Container box", endswith=", box.")
     box = db.find(lambda x: x.name == "box")
     self.assertIsInstance(box, db.Container)
     self.assertEqual(box.location, self.player)
     self.assert_response("create muss.equipment.Equipment snake",
                          endswith=", snake.")
     snake = db.find(lambda x: x.name == "snake")
     self.assertIsInstance(snake, equipment.Equipment)
     self.assertEqual(snake.location, self.player)
コード例 #3
0
ファイル: test_login.py プロジェクト: mongolsamurai/MUSS
    def test_connected_attr(self):
        self.proto.dataReceived("new\r\nname\r\npass\r\npass\r\n")
        self.proto.connectionLost(reason=None)
        self.new_connection()
        self.tr.clear()

        player = db.find(lambda x: x.name == "name")

        self.assertTrue(not player.connected)
        self.assert_response("name pass\r\n", startswith="Hello, name!\r\n\r\n")
        self.assertTrue(player.connected)

        self.proto.dataReceived("quit\r\n")
        self.assertTrue(player.connected)
コード例 #4
0
ファイル: test_login.py プロジェクト: rlazarus/MUSS
    def test_connected_attr(self):
        self.proto.dataReceived("new\r\nname\r\npass\r\npass\r\n")
        self.proto.connectionLost(reason=None)
        self.new_connection()
        self.tr.clear()

        player = db.find(lambda x: x.name == "name")

        self.assertTrue(not player.connected)
        self.assert_response("name pass\r\n",
                             startswith="Hello, name!\r\n\r\n")
        self.assertTrue(player.connected)

        self.proto.dataReceived("quit\r\n")
        self.assertTrue(player.connected)