示例#1
0
 def test_build(self):
     conn = PlayerConnection()
     with WrappedConsoleIO(conn) as io:
         conn.io = io
         b = CharacterBuilder(conn, None)
         builder = b.build_async()
         why, what = next(builder)
         self.assertEqual("input", why)
示例#2
0
 def test_build(self):
     conn = PlayerConnection()
     with WrappedConsoleIO(conn) as io:
         conn.io = io
         b = CharacterBuilder(conn, None)
         builder = b.build_async()
         why, what = next(builder)
         self.assertEqual("input", why)
示例#3
0
 def test_apply_to(self):
     b = CharacterBuilder(None)
     p = Player("test", "n")
     pn = b.create_default_wizard()
     self.assertFalse("wizard" in p.privileges)
     self.assertEqual("Test", p.title)
     pn.apply_to(p)
     self.assertTrue("wizard" in p.privileges)
     self.assertEqual("rinzwind", p.name)
     self.assertEqual("human", p.race)
     self.assertEqual("m", p.gender)
     self.assertEqual("arch wizard Rinzwind", p.title)
示例#4
0
 def test_build(self):
     b = CharacterBuilder(None)
     pn = b.create_default_player()
     self.assertFalse(pn.wizard)
     pn = b.create_default_wizard()
     self.assertTrue(pn.wizard)