Esempio n. 1
0
    def parse(self, element):
        subelement = element.find('channels')
        if subelement is None:
            raise ValueError("Element 'channels' not found")
        channels = self._parse_numerical_parameter(subelement)

        return _ChannelsDetector(channels)
Esempio n. 2
0
    def setUp(self):
        unittest.TestCase.setUp(self)

        self.h = _ChannelsDetectorXMLHandler()

        self.obj = _ChannelsDetector(10)

        etree.register_namespace("mc", "http://pymontecarlo.sf.net")
        source = BytesIO(
            b'<mc:_channelsDetector xmlns:mc="http://pymontecarlo.sf.net"><channels>10</channels></mc:_channelsDetector>'
        )
        self.element = etree.parse(source).getroot()
Esempio n. 3
0
    def setUp(self):
        TestCase.setUp(self)

        self.d = _ChannelsDetector(10)