Beispiel #1
0
 def test_relax_not_in_forest(self):
    for loc in ("village", "black rock city", "tower"):
         wiz = wiz11.Wizard(location=loc)
         self.assertEqual(
             wiz11.request(wiz, "relax"),
             "You can't relax in " + wiz.location + "."
     )
Beispiel #2
0
 def test_brew_not_tower(self):
    for loc in ("village", "black rock city", "forest"):
         wiz = wiz11.Wizard(location=loc)
         self.assertEqual(
             wiz11.request(wiz, "brew"),
             "You cannot brew potions in the " + wiz.location + "."
     )
Beispiel #3
0
 def test_gift_not_in_brc(self):
     for loc in ("village", "forest", "tower"):
         wiz = wiz11.Wizard(location=loc)
         self.assertEqual(
             wiz11.request(wiz, "gift"),
             "You cannot give gifts in the " + wiz.location + "."
     )
Beispiel #4
0
 def test_forage_not_forest(self):
    for loc in ("village", "black rock city", "tower"):
         wiz = wiz11.Wizard(location=loc)
         self.assertEqual(
             wiz11.request(wiz, "forage"),
             "There are no mushrooms in the " + wiz.location + "."
     )
Beispiel #5
0
 def test_work_not_village(self):
    for loc in ("tower", "black rock city", "forest"):
         wiz = wiz11.Wizard(location=loc)
         self.assertEqual(
             wiz11.request(wiz, "work"),
             "There is no work in the " + wiz.location + "."
     )
Beispiel #6
0
 def test_health(self):
     wiz = wiz11.Wizard(stress=5, skill=5)
     self.assertEqual(
         wiz11.request(wiz, "health"),
         '''   You have a stress level of 5.\n'''
         '''   You have a skill level of 5.'''
     )
Beispiel #7
0
 def test_shop_not_village(self):
    for loc in ("tower", "black rock city", "forest"):
         wiz = wiz11.Wizard(location=loc)
         self.assertEqual(
             wiz11.request(wiz, "shop"),
             "You can't shop in the " + wiz.location + "."
     )
Beispiel #8
0
 def test_purse(self):
     wiz = wiz11.Wizard(books=2, gold=2, mushrooms=0, potions=4)
     self.assertEqual(
         wiz11.request(wiz, "purse"),
         '''   You have 2 books\n'''
         '''   You have 2 gold\n'''
         '''   You have 0 mushrooms\n'''
         '''   You have 4 potions'''
     )
Beispiel #9
0
 def test_brew_tower_mushrooms(self):
     wiz = wiz11.Wizard(location="tower", mushrooms=3, potions=1)
     self.assertEqual(
         wiz11.request(wiz, "brew"),
         "You now have 2 potions."
     )
     self.assertEqual(wiz.mushrooms, 2)
     self.assertEqual(wiz.potions, 2)
     self.assertEqual(wiz.stress, -1)
Beispiel #10
0
 def test_travel_village_already_there(self):
     wiz = wiz11.Wizard(location="village")
     self.assertEqual(
         wiz11.request(wiz, "village"),
         "You are already in the village."
     )
Beispiel #11
0
 def test_travel_brc(self):
     wiz = wiz11.Wizard(location="tower")
     self.assertEqual(
         wiz11.request(wiz, "black rock city"),
         "You travel to the playa )'(."
     )
Beispiel #12
0
 def test_shop_too_stressed(self):
     wiz = wiz11.Wizard(location="village", stress=11, skill=2)
     self.assertEqual(
         wiz11.request(wiz, "work"),
         "You are too stressed out. Go do relaxing things."
     )
Beispiel #13
0
 def test_travel_village(self):
     wiz = wiz11.Wizard(location="tower")
     self.assertEqual(
         wiz11.request(wiz, "village"),
         "You travel to your village where you can work, sell goods and shop."
     )
Beispiel #14
0
 def test_travel_tower(self):
     wiz = wiz11.Wizard(location="village")
     self.assertEqual(
         wiz11.request(wiz, "tower"),
         "You travel to your tower where there is peace and quiet."
     )
Beispiel #15
0
 def test_work_no_skills(self):
     wiz = wiz11.Wizard(location="village", skill=0)
     self.assertEqual(
         wiz11.request(wiz, "work"),
         "You can't work without any skills."
     )
Beispiel #16
0
 def test_shop_no_gold(self):
     wiz = wiz11.Wizard(location="village", gold=0)
     self.assertEqual(
         wiz11.request(wiz, "shop"),
         "You have 0 gold. You must work to earn gold."
     )
Beispiel #17
0
 def test_study_with_books(self):
     wiz = wiz11.Wizard(location="tower", books=1)
     self.assertEqual(
         wiz11.request(wiz, "study"),
         "Your skill level is now 1."
     )
Beispiel #18
0
 def test_gift_no_potions(self):
     wiz = wiz11.Wizard(location="black rock city")
     self.assertEqual(
         wiz11.request(wiz, "gift"),
         "You have no potions to gift."
     )
Beispiel #19
0
 def test_gift_in_brc_with_stress(self):
     wiz = wiz11.Wizard(location="black rock city", potions=6, stress=2)
     self.assertEqual(
         wiz11.request(wiz, "gift"),
         "You now have 5 potions and you have lowered your stress level."
     )
Beispiel #20
0
 def test_shop_in_village(self):
     wiz = wiz11.Wizard(location="village", gold=1)
     self.assertEqual(
         wiz11.request(wiz, "shop"),
         "You now have 2 books and 0 gold."
     )
Beispiel #21
0
 def test_sell_in_village(self):
     wiz = wiz11.Wizard(location="village", gold=3, potions=3)
     self.assertEqual(
         wiz11.request(wiz, "sell"),
         "You now have 4 gold."
     )
Beispiel #22
0
 def test_sell_in_village_no_potions(self):
     wiz = wiz11.Wizard(location="village", gold=3)
     self.assertEqual(
         wiz11.request(wiz, "sell"),
         "You have no brewed potions to sell."
     )
Beispiel #23
0
 def test_travel_brc_already_there(self):
     wiz = wiz11.Wizard(location="black rock city")
     self.assertEqual(
         wiz11.request(wiz, "black rock city"),
         "You are already in the black rock city."
     )
Beispiel #24
0
 def test_work_in_village(self):
     wiz = wiz11.Wizard(location="village", gold=2, skill=3)
     self.assertEqual(
         wiz11.request(wiz, "work"),
         "All in a day's work. You now have 3 gold."
     )
Beispiel #25
0
 def test_study_in_tower(self):
     wiz = wiz11.Wizard(location="tower")
     self.assertEqual(
         wiz11.request(wiz, "study"),
         "Your skill level is now 1."
     )
Beispiel #26
0
 def test_gift_in_brc(self):
     wiz = wiz11.Wizard(location="black rock city", potions=6, stress=0)
     self.assertEqual(
         wiz11.request(wiz, "gift"),
         "You now have 5 potions."
     )
Beispiel #27
0
 def test_study_with_no_books(self):
     wiz = wiz11.Wizard(location="tower", books=0)
     self.assertEqual(
         wiz11.request(wiz, "study"),
         "You have no more new books to read."
     )
Beispiel #28
0
 def test_relax_in_forest(self):
     wiz = wiz11.Wizard(location="forest", stress=1)
     self.assertEqual(
         wiz11.request(wiz, "relax"),
         "You now have 0 stress level."
     )
Beispiel #29
0
 def test_brew_no_mushrooms(self):
     wiz = wiz11.Wizard(location="tower", mushrooms=0)
     self.assertEqual(
         wiz11.request(wiz, "brew"),
         "You can't brew potions without mushrooms."
     )
Beispiel #30
0
 def test_travel_tower_already_there(self):
     wiz = wiz11.Wizard(location="tower")
     self.assertEqual(
         wiz11.request(wiz, "tower"),
         "You are already in the tower."
     )