Completed
Pull Request — master (#327)
by Tomaz
03:46
created

ParseXMLActionTestCase.test_run()   A

Complexity

Conditions 1

Size

Total Lines 11

Duplication

Lines 0
Ratio 0 %
Metric Value
cc 1
dl 0
loc 11
rs 9.4286
1
import unittest2
2
3
from parse_xml import ParseXMLAction
4
5
__all__ = [
6
    'ParseXMLActionTestCase'
7
]
8
9
MOCK_DATA_1 = """
10
<note>
11
<to>Tove</to>
12
<from>Jani</from>
13
<heading>Reminder</heading>
14
<body>Don't forget me this weekend!</body>
15
</note>
16
""".strip()
17
18
19
class ParseXMLActionTestCase(unittest2.TestCase):
20
    def test_run(self):
21
        result = ParseXMLAction().run(data=MOCK_DATA_1)
22
        expected = {
23
            'note': {
24
                'to': 'Tove',
25
                'from': 'Jani',
26
                'heading': 'Reminder',
27
                'body': 'Don\'t forget me this weekend!'
28
            }
29
        }
30
        self.assertEqual(result, expected)
31