~widelands-dev/widelands-website/django_staticfiles

« back to all changes in this revision

Viewing changes to widelandslib/test/test_conf.py

  • Committer: Holger Rapp
  • Date: 2009-02-19 15:31:42 UTC
  • Revision ID: sirver@h566336-20090219153142-dc8xuabldnw5t395
Initial commit of new widelands homepage

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
 
 
21
 
class _WLConfigParser_Base(unittest.TestCase):
22
 
 
23
 
    def setUp(self):
24
 
        self.cp = WidelandsConfigParser(StringIO(self.input))
25
 
 
26
 
 
27
 
class TestWLConfigParser_TestStringSubstitution_ExceptCorrectResult(_WLConfigParser_Base):
28
 
    # {{{ Data
29
 
    input = """[global]
30
 
descr=_"The breath-taking beauty of these emerald lands has lured many a tribe into the attempt of taking them for itself."
31
 
"""
32
 
    wanted = 'The breath-taking beauty of these emerald lands has lured many a tribe into the attempt of taking them for itself.'
33
 
    # }}}
34
 
 
35
 
    def runTest(self):
36
 
        self.assertEqual(self.cp.getstring('global', 'descr'), self.wanted)
37
 
 
38
 
 
39
 
if __name__ == '__main__':
40
 
    unittest.main()
41
 
    # k = TestMacro_UnmatchedExitm_ExceptRaise()
42
 
    # unittest.TextTestRunner().run(k)