~widelands-dev/widelands-website/django_staticfiles

« back to all changes in this revision

Viewing changes to widelandslib/test/test_conf.py

  • Committer: franku
  • Date: 2016-12-13 18:28:51 UTC
  • mto: This revision was merged to the branch mainline in revision 443.
  • Revision ID: somal@arcor.de-20161213182851-bo5ebf8pdvw5beua
run the script

Show diffs side-by-side

added added

removed removed

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