Back to index

python3.2  3.2.2
Public Member Functions | Static Public Attributes
test.test_cfgparser.CompatibleTestCase Class Reference
Inheritance diagram for test.test_cfgparser.CompatibleTestCase:
Inheritance graph
[legend]
Collaboration diagram for test.test_cfgparser.CompatibleTestCase:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def test_comment_handling
def newconfig
def fromstring

Static Public Attributes

 config_class = configparser.RawConfigParser
string comment_prefixes = '#;'
string inline_comment_prefixes = ';'
 allow_no_value = False
tuple delimiters = ('=', ':')
 empty_lines_in_values = True
 dict_type = configparser._default_dict
 strict = False
 default_section = configparser.DEFAULTSECT
 interpolation = configparser._UNSET

Detailed Description

Definition at line 1299 of file test_cfgparser.py.


Member Function Documentation

def test.test_cfgparser.CfgParserTestCaseClass.fromstring (   self,
  string,
  defaults = None 
) [inherited]

Reimplemented in test.test_cfgparser.CopyTestCase.

Definition at line 62 of file test_cfgparser.py.

00062 
00063     def fromstring(self, string, defaults=None):
00064         cf = self.newconfig(defaults)
00065         cf.read_string(string)
00066         return cf

Here is the call graph for this function:

Here is the caller graph for this function:

def test.test_cfgparser.CfgParserTestCaseClass.newconfig (   self,
  defaults = None 
) [inherited]

Definition at line 46 of file test_cfgparser.py.

00046 
00047     def newconfig(self, defaults=None):
00048         arguments = dict(
00049             defaults=defaults,
00050             allow_no_value=self.allow_no_value,
00051             delimiters=self.delimiters,
00052             comment_prefixes=self.comment_prefixes,
00053             inline_comment_prefixes=self.inline_comment_prefixes,
00054             empty_lines_in_values=self.empty_lines_in_values,
00055             dict_type=self.dict_type,
00056             strict=self.strict,
00057             default_section=self.default_section,
00058             interpolation=self.interpolation,
00059         )
00060         instance = self.config_class(**arguments)
00061         return instance

Here is the caller graph for this function:

Definition at line 1304 of file test_cfgparser.py.

01304 
01305     def test_comment_handling(self):
01306         config_string = textwrap.dedent("""\
01307         [Commented Bar]
01308         baz=qwe ; a comment
01309         foo: bar # not a comment!
01310         # but this is a comment
01311         ; another comment
01312         quirk: this;is not a comment
01313         ; a space must precede an inline comment
01314         """)
01315         cf = self.fromstring(config_string)
01316         self.assertEqual(cf.get('Commented Bar', 'foo'),
01317                          'bar # not a comment!')
01318         self.assertEqual(cf.get('Commented Bar', 'baz'), 'qwe')
01319         self.assertEqual(cf.get('Commented Bar', 'quirk'),
01320                          'this;is not a comment')

Here is the call graph for this function:


Member Data Documentation

Reimplemented from test.test_cfgparser.CfgParserTestCaseClass.

Definition at line 1301 of file test_cfgparser.py.

Definition at line 1300 of file test_cfgparser.py.

tuple test.test_cfgparser.CfgParserTestCaseClass.delimiters = ('=', ':') [static, inherited]
test.test_cfgparser.CfgParserTestCaseClass.dict_type = configparser._default_dict [static, inherited]

Reimplemented in test.test_cfgparser.SortedTestCase.

Definition at line 41 of file test_cfgparser.py.

Reimplemented in test.test_cfgparser.RawConfigParserTestSambaConf.

Definition at line 40 of file test_cfgparser.py.

Reimplemented from test.test_cfgparser.CfgParserTestCaseClass.

Definition at line 1302 of file test_cfgparser.py.


The documentation for this class was generated from the following file: