~ubuntu-branches/ubuntu/karmic/python-docutils/karmic

« back to all changes in this revision

Viewing changes to test/test_language.py

  • Committer: Bazaar Package Importer
  • Author(s): martin f. krafft
  • Date: 2006-07-10 11:45:05 UTC
  • mfrom: (2.1.4 edgy)
  • Revision ID: james.westby@ubuntu.com-20060710114505-otkhqcslevewxmz5
Tags: 0.4-3
Added build dependency on python-central (closes: #377580).

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 
3
3
# Authors:   Engelbert Gruber; David Goodger
4
4
# Contact:   grubert@users.sourceforge.net
5
 
# Revision:  $Revision: 1.8 $
6
 
# Date:      $Date: 2004/04/16 16:40:58 $
 
5
# Revision:  $Revision: 4132 $
 
6
# Date:      $Date: 2005-12-03 03:13:12 +0100 (Sat, 03 Dec 2005) $
7
7
# Copyright: This module has been placed in the public domain.
8
8
 
9
9
"""
17
17
import os
18
18
import re
19
19
from types import UnicodeType
 
20
import DocutilsTestSupport              # must be imported before docutils
20
21
import docutils.languages
21
22
import docutils.parsers.rst.languages
22
23
from docutils.parsers.rst import states, directives, roles
23
 
from DocutilsTestSupport import CustomTestSuite, CustomTestCase
 
24
 
24
25
 
25
26
reference_language = 'en'
26
27
 
27
28
 
28
 
class LanguageTestSuite(CustomTestSuite):
 
29
class LanguageTestSuite(DocutilsTestSupport.CustomTestSuite):
29
30
 
30
31
    language_module_pattern = re.compile('^([a-z]{2,3}(_[a-z]{2,8})*)\.py$')
31
32
 
32
33
    def __init__(self, languages=None):
33
 
        CustomTestSuite.__init__(self)
 
34
        DocutilsTestSupport.CustomTestSuite.__init__(self)
34
35
        if languages:
35
36
            self.languages = languages
36
37
        else:
56
57
                                 id=language+'.py', language=language)
57
58
 
58
59
 
59
 
class LanguageTestCase(CustomTestCase):
 
60
class LanguageTestCase(DocutilsTestSupport.CustomTestCase):
60
61
 
61
62
    test_methods = ['test_labels', 'test_bibliographic_fields',
62
63
                    'test_directives', 'test_roles']
66
67
        self.ref = docutils.languages.get_language(reference_language)
67
68
        self.language = kwargs['language']
68
69
        del kwargs['language']          # only wanted here
69
 
        CustomTestCase.__init__(self, *args, **kwargs)
 
70
        DocutilsTestSupport.CustomTestCase.__init__(self, *args, **kwargs)
70
71
 
71
72
    def _xor(self, ref_dict, l_dict):
72
73
        """