()
| 88 | |
| 89 | |
| 90 | def test(): |
| 91 | dic = readConfig("sample.xml") |
| 92 | |
| 93 | print dic["Config"]["Name"] |
| 94 | |
| 95 | print "Item Type:", dic["Config"]["Items"]["Type"] |
| 96 | for item in dic["Config"]["Items"]["Item"]: |
| 97 | print "Item's Name:", item["Name"] |
| 98 | print "Item's Value:", item["Value"] |
| 99 | |
| 100 | """ |
| 101 | ================================================== |
| 102 | sample.xml: |
| 103 | ================================================== |
| 104 | <?xml version="1.0" encoding="UTF-8"?> |
| 105 | |
| 106 | <Config> |
| 107 | <Name>My Config File</Name> |
| 108 | |
| 109 | <Items> |
| 110 | <Type>Item type</Type> |
| 111 | <Item> |
| 112 | <Name>First Item</Name> |
| 113 | <Value>Value 1</Value> |
| 114 | </Item> |
| 115 | <Item> |
| 116 | <Name>Second Item</Name> |
| 117 | <Value>Value 2</Value> |
| 118 | </Item> |
| 119 | </Items> |
| 120 | |
| 121 | </Config> |
| 122 | |
| 123 | |
| 124 | ================================================== |
| 125 | output: |
| 126 | ================================================== |
| 127 | [u'My Config File'] |
| 128 | |
| 129 | Item Type: Item type |
| 130 | Item's Name: First Item |
| 131 | Item's Value: Value 1 |
| 132 | Item's Name: Second Item |
| 133 | Item's Value: Value 2 |
| 134 | """ |
| 135 |
nothing calls this directly
no test coverage detected