~widelands-dev/widelands-website/django_staticfiles

« back to all changes in this revision

Viewing changes to widelandslib/test/test_tribe.py

  • Committer: Timo Paulssen
  • Date: 2010-11-01 01:06:11 UTC
  • mto: This revision was merged to the branch mainline in revision 227.
  • Revision ID: timonator@perpetuum-immobile.de-20101101010611-ve6y7773nlofd9dh
moved over widelandslib from lp:~tmk/widelands/help-gen-ng with some fixes,
changed update_help to use widelandslib.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/env python -tt
 
2
# encoding: utf-8
 
3
#
 
4
 
 
5
import sys
 
6
sys.path.append("..")
 
7
 
 
8
from nose.tools import *
 
9
 
 
10
from tribe import Tribe
 
11
 
 
12
 
 
13
class TestTribe(object):
 
14
    def setUp(self):
 
15
        self.b = Tribe("barbarians")
 
16
        self.e = Tribe("empire")
 
17
        self.a = Tribe("atlanteans")
 
18
 
 
19
    def test_produces(self):
 
20
        assert_equal([
 
21
            "axe", "battleaxe", "broadaxe", "bronzeaxe",
 
22
            "sharpaxe", "warriorsaxe"
 
23
        ], self.b.buildings["warmill"].outputs)
 
24
 
 
25
    def test_enhancement(self):
 
26
        assert_equal("warmill", self.b.buildings["axefactory"].enhancement)
 
27
 
 
28
    def test_enhanced_building(self):
 
29
        assert_equal(True, self.b.buildings["warmill"].enhanced_building)
 
30
        assert_equal(False, self.b.buildings["lumberjacks_hut"]
 
31
                     .enhanced_building)
 
32