~ubuntu-branches/debian/squeeze/configobj/squeeze

« back to all changes in this revision

Viewing changes to tests/functionaltests/test_configobj.py

  • Committer: Bazaar Package Importer
  • Author(s): Stefano Rivera, Sandro Tosi, Stefano Rivera
  • Date: 2010-02-01 01:34:21 UTC
  • mfrom: (1.3.1 upstream) (6.1.1 experimental)
  • Revision ID: james.westby@ubuntu.com-20100201013421-jnt5mxdpfpsrjawy
Tags: 4.7.0-1
[ Sandro Tosi ]
* debian/control
  - switch Vcs-Browser field to viewsvn

[ Stefano Rivera ]
* New upstream release. (Closes: 555407)
* Package under team maintenance. (Closes: 544448)
* Bumped Standards-Version to 3.8.4 (no changes needed).
* Converted to 3.0 (quilt)
* debian/rules
  - Converted to debhelper 7 overrides
  - Don't compress epydoc.js
* Patches:
  - 01_eggify.dpatch converted to eggify.diff (quilt+DEP3).
  - 02_doc_generation_fix.dpatch removed (fixed upstream)
* debain/control
  - Unversioned python-setuptools dependency (oldstable has a suitable
    version)
  - Removed unecessary XB-Python-Version.
  - Minor changes to description.
* debian/copyright
  - Updated years and added author Mark Andrews.
  - Included full license, as it isn't identical to the common-licenses one.
* debian/watch
  - Switched from sf.net to author's homepage, as redirector can't see
    4.7.0.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
import os
 
2
import unittest
 
3
from configobj import ConfigObj
 
4
 
 
5
class TestConfigObj(unittest.TestCase):
 
6
    
 
7
    def test_order_preserved(self):
 
8
        c = ConfigObj()
 
9
        c['a'] = 1
 
10
        c['b'] = 2
 
11
        c['c'] = 3
 
12
        c['section'] = {}
 
13
        c['section']['a'] = 1
 
14
        c['section']['b'] = 2
 
15
        c['section']['c'] = 3
 
16
        c['section']['section'] = {}
 
17
        c['section']['section2'] = {}
 
18
        c['section']['section3'] = {}
 
19
        c['section2'] = {}
 
20
        c['section3'] = {}
 
21
        
 
22
        c2 = ConfigObj(c)
 
23
        self.assertEqual(c2.scalars, ['a', 'b', 'c'])
 
24
        self.assertEqual(c2.sections, ['section', 'section2', 'section3'])
 
25
        self.assertEqual(c2['section'].scalars, ['a', 'b', 'c'])
 
26
        self.assertEqual(c2['section'].sections, ['section', 'section2', 'section3'])
 
27
        
 
28
        self.assertFalse(c['section'] is c2['section'])
 
29
        self.assertFalse(c['section']['section'] is c2['section']['section'])
 
 
b'\\ No newline at end of file'