Beispiel #1
0
    def test_non_existing_type(self):
        el = etree.fromstring('''
            <root>
                <altRecordID TYPE="foo">bar</altRecordID>
            </root>
        ''')

        self.assertEqual(get_altrecordid(el, 'bar'), [])
Beispiel #2
0
    def test_multiple_results(self):
        el = etree.fromstring('''
            <root>
                <altRecordID TYPE="foo">first</altRecordID>
                <altRecordID TYPE="foo">second</altRecordID>
            </root>
        ''')

        self.assertEqual(get_altrecordid(el, 'foo'), ['first', 'second'])
Beispiel #3
0
    def test_non_existing_element(self):
        el = etree.fromstring('''
            <root></root>
        ''')

        self.assertEqual(get_altrecordid(el, 'bar'), [])