Exemple #1
0
    def test_timeInstantParser(self):
        """Time instant parser"""

        timeParser = XMLParserFactory.getInstance("GMLTime")()
        xml = '<om:samplingTime>\
                <gml:TimeInstant xsi:type="gml:TimeInstantType">\
                    <gml:timePosition>2015-03-17T17:29:00.000</gml:timePosition>\
                </gml:TimeInstant>\
            </om:samplingTime>'

        self.assertEqual(str(timeParser.parse(xml)), '2015-03-17T17:29:00')
Exemple #2
0
 def test_timeInstantParser (self):
     """Time instant parser"""
     
     timeParser = XMLParserFactory.getInstance ("GMLTime")()
     xml = '<om:samplingTime>\
             <gml:TimeInstant xsi:type="gml:TimeInstantType">\
                 <gml:timePosition>2015-03-17T17:29:00.000</gml:timePosition>\
             </gml:TimeInstant>\
         </om:samplingTime>'
         
     self.assertEqual(str(timeParser.parse(xml)), '2015-03-17T17:29:00')
Exemple #3
0
 def test_timePeriodParser (self):
     """Time period parser"""
     
     timeParser = XMLParserFactory.getInstance ("GMLTime")()
     xml = '<om:samplingTime xmlns:om="http://www.opengis.net/om/1.0">\
             <gml:TimePeriod xmlns:gml="http://www.opengis.net/gml" xsi:type="gml:TimePeriodType" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">\
                 <gml:beginPosition xmlns:gml="http://www.opengis.net/gml">2015-01-28T20:40:00.000</gml:beginPosition>\
                 <gml:endPosition xmlns:gml="http://www.opengis.net/gml">2015-01-28T20:50:00.000</gml:endPosition>\
             </gml:TimePeriod>\
         </om:samplingTime>'
         
     self.assertEqual(str(timeParser.parse(xml)), '2015-01-28T20:40:00 2015-01-28T20:50:00')
Exemple #4
0
    def test_timePeriodParser(self):
        """Time period parser"""

        timeParser = XMLParserFactory.getInstance("GMLTime")()
        xml = '<om:samplingTime xmlns:om="http://www.opengis.net/om/1.0">\
                <gml:TimePeriod xmlns:gml="http://www.opengis.net/gml" xsi:type="gml:TimePeriodType" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">\
                    <gml:beginPosition xmlns:gml="http://www.opengis.net/gml">2015-01-28T20:40:00.000</gml:beginPosition>\
                    <gml:endPosition xmlns:gml="http://www.opengis.net/gml">2015-01-28T20:50:00.000</gml:endPosition>\
                </gml:TimePeriod>\
            </om:samplingTime>'

        self.assertEqual(str(timeParser.parse(xml)),
                         '2015-01-28T20:40:00 2015-01-28T20:50:00')