def test_normalize_tag(self): assert normalize_tag( '{http://www.suunto.com/schemas/sml}SwimPace') == 'swim_pace' assert normalize_tag('ascentTime') == 'ascent_time' assert normalize_tag('TheAvgMove') == 'the_avg_move' assert normalize_tag('move_time') == 'move_time' assert normalize_tag('gpsHDOP') == 'gps_hdop'
def parse_move(tree): device_log = tree.DeviceLog move = Move() add_children(move, device_log.Header) for child in device_log.Device.Info.iterchildren(): tag = normalize_tag(child.tag) attr = "device_info_%s" % tag.lower() set_attr(move, attr, child.text) normalize_move(move) return move
def test_normalize_tag(self): assert normalize_tag('{http://www.suunto.com/schemas/sml}SwimPace') == 'swim_pace' assert normalize_tag('ascentTime') == 'ascent_time' assert normalize_tag('TheAvgMove') == 'the_avg_move' assert normalize_tag('move_time') == 'move_time' assert normalize_tag('gpsHDOP') == 'gps_hdop'