~widelands-dev/widelands-website/django_staticfiles

« back to all changes in this revision

Viewing changes to widelandslib/test/test_conf.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
# File: test_macro.py
 
5
#
 
6
# Created by Holger Rapp on 18.01.09  
 
7
# Copyright (c) 2009 HolgerRapp@gmx.net. All rights reserved.
 
8
#
 
9
# Last Modified: $Date$
 
10
#
 
11
 
 
12
import sys
 
13
sys.path.append("..")
 
14
 
 
15
import unittest
 
16
from cStringIO import StringIO
 
17
 
 
18
from conf import WidelandsConfigParser
 
19
 
 
20
class _WLConfigParser_Base( unittest.TestCase ):
 
21
    def setUp(self):
 
22
        self.cp = WidelandsConfigParser( StringIO(self.input ))
 
23
        
 
24
class TestWLConfigParser_TestStringSubstitution_ExceptCorrectResult(_WLConfigParser_Base):
 
25
    # {{{ Data
 
26
    input="""[global]
 
27
descr=_"The breath-taking beauty of these emerald lands has lured many a tribe into the attempt of taking them for itself."
 
28
"""
 
29
    wanted = "The breath-taking beauty of these emerald lands has lured many a tribe into the attempt of taking them for itself."
 
30
    # }}}
 
31
    def runTest(self):
 
32
        self.assertEqual( self.cp.getstring("global","descr"), self.wanted )
 
33
 
 
34
 
 
35
if __name__ == '__main__':
 
36
    unittest.main()
 
37
    # k = TestMacro_UnmatchedExitm_ExceptRaise()
 
38
    # unittest.TextTestRunner().run(k)
 
39