Completed
Pull Request — master (#327)
by Tomaz
05:25 queued 35s
created

ParseXMLActionTestCase   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 0 %
Metric Value
dl 0
loc 12
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A test_run() 0 11 1
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