def test_simplest_xml(self): p = pxml.Pipeline() p.source = pxml.Reader('foo') xml = p.xml() self.assertEqual(xml.getroot().attrib['version'], version.as_string()) self.assertEqual( xml.find('Reader').attrib['type'], 'drivers.foo.reader')
def test_reader_source_error(self): reader = pxml.Reader('foo') otherreader = pxml.Reader('bar') self.assertRaises(ValueError, setattr, reader, 'source', otherreader)
def test_multifilter_source(self): mfilter = pxml.MultiFilter('multi') mfilter.source = [pxml.Reader('foo'), pxml.Reader('bar')] xml = mfilter.xml() self.assertEqual(len(xml.findall('Reader')), 2)