当前位置: 首页>>代码示例>>Python>>正文


Python UsfirstEventDetailsParser.parse方法代码示例

本文整理汇总了Python中datafeeds.usfirst_event_details_parser.UsfirstEventDetailsParser.parse方法的典型用法代码示例。如果您正苦于以下问题:Python UsfirstEventDetailsParser.parse方法的具体用法?Python UsfirstEventDetailsParser.parse怎么用?Python UsfirstEventDetailsParser.parse使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在datafeeds.usfirst_event_details_parser.UsfirstEventDetailsParser的用法示例。


在下文中一共展示了UsfirstEventDetailsParser.parse方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_2012ct_bad_location

# 需要导入模块: from datafeeds.usfirst_event_details_parser import UsfirstEventDetailsParser [as 别名]
# 或者: from datafeeds.usfirst_event_details_parser.UsfirstEventDetailsParser import parse [as 别名]
    def test_2012ct_bad_location(self):
        with open('test_data/usfirst_html/usfirst_event_details_2012ct.html', 'r') as f:
            event, _ = UsfirstEventDetailsParser.parse(f.read())

        event['location'] = "somewhere on mars"
        self.assertEqual(LocationHelper.get_lat_lng(event['location']), None)
        self.assertEqual(LocationHelper.get_timezone_id(event['location']), None)
开发者ID:legoktm,项目名称:the-blue-alliance,代码行数:9,代码来源:test_event_get_timezone_id.py

示例2: test_parse2013flbr

# 需要导入模块: from datafeeds.usfirst_event_details_parser import UsfirstEventDetailsParser [as 别名]
# 或者: from datafeeds.usfirst_event_details_parser.UsfirstEventDetailsParser import parse [as 别名]
    def test_parse2013flbr(self):
        with open('test_data/usfirst_html/usfirst_event_details_2013flbr.html', 'r') as f:
            event = UsfirstEventDetailsParser.parse(f.read())

        self.assertEqual(event["name"], "South Florida Regional")
        self.assertEqual(event["event_type"], "Regional")
        self.assertEqual(event["start_date"], datetime.datetime(2013, 3, 28, 0, 0))
        self.assertEqual(event["end_date"], datetime.datetime(2013, 3, 30, 0, 0))
        self.assertEqual(event["year"], 2013)
        self.assertEqual(event["venue_address"], "Great Fort Lauderdale & Broward County Convention Center\r\n1950 Eisenhower Boulevard\r\nFort Lauderdale, FL 33316\r\nUSA")
        self.assertEqual(event["website"], "http://firstinflorida.org")
        self.assertEqual(event["event_short"], "flbr")
开发者ID:dweitz,项目名称:the-blue-alliance,代码行数:14,代码来源:test_usfirst_event_details_parser.py

示例3: test_1997il

# 需要导入模块: from datafeeds.usfirst_event_details_parser import UsfirstEventDetailsParser [as 别名]
# 或者: from datafeeds.usfirst_event_details_parser.UsfirstEventDetailsParser import parse [as 别名]
    def test_1997il(self):
        with open('test_data/usfirst_html/usfirst_event_details_1997il.html', 'r') as f:
            event, _ = UsfirstEventDetailsParser.parse(f.read())

        location = None
        for _ in xrange(5):
            location = LocationHelper.get_lat_lng(event['location'])
            if location:
                break
        self.assertAlmostEqual(location[0], 41.8781136, places=6)
        self.assertAlmostEqual(location[1], -87.6297982, places=6)
        self.assertEqual(LocationHelper.get_timezone_id(event['location']), 'America/Chicago')
开发者ID:legoktm,项目名称:the-blue-alliance,代码行数:14,代码来源:test_event_get_timezone_id.py

示例4: test_2012ct

# 需要导入模块: from datafeeds.usfirst_event_details_parser import UsfirstEventDetailsParser [as 别名]
# 或者: from datafeeds.usfirst_event_details_parser.UsfirstEventDetailsParser import parse [as 别名]
    def test_2012ct(self):
        with open('test_data/usfirst_html/usfirst_event_details_2012ct.html', 'r') as f:
            event, _ = UsfirstEventDetailsParser.parse(f.read())

        location = None
        for _ in xrange(5):
            location = LocationHelper.get_lat_lng(event['location'])
            if location:
                break
        self.assertAlmostEqual(location[0], 41.76371109999999, places=6)
        self.assertAlmostEqual(location[1], -72.6850932, places=6)
        self.assertEqual(LocationHelper.get_timezone_id(event['location']), 'America/New_York')
开发者ID:legoktm,项目名称:the-blue-alliance,代码行数:14,代码来源:test_event_get_timezone_id.py

示例5: test_2013flbr

# 需要导入模块: from datafeeds.usfirst_event_details_parser import UsfirstEventDetailsParser [as 别名]
# 或者: from datafeeds.usfirst_event_details_parser.UsfirstEventDetailsParser import parse [as 别名]
    def test_2013flbr(self):
        with open('test_data/usfirst_html/usfirst_event_details_2013flbr.html', 'r') as f:
            event, _ = UsfirstEventDetailsParser.parse(f.read())

        location = None
        for _ in xrange(5):
            location = LocationHelper.get_lat_lng(event['location'])
            if location:
                break
        self.assertAlmostEqual(location[0], 26.1224386, places=6)
        self.assertAlmostEqual(location[1], -80.13731740000001, places=6)
        self.assertEqual(LocationHelper.get_timezone_id(event['location']), 'America/New_York')
开发者ID:legoktm,项目名称:the-blue-alliance,代码行数:14,代码来源:test_event_get_timezone_id.py

示例6: test_2005is

# 需要导入模块: from datafeeds.usfirst_event_details_parser import UsfirstEventDetailsParser [as 别名]
# 或者: from datafeeds.usfirst_event_details_parser.UsfirstEventDetailsParser import parse [as 别名]
    def test_2005is(self):
        with open('test_data/usfirst_html/usfirst_event_details_2005is.html', 'r') as f:
            event, _ = UsfirstEventDetailsParser.parse(f.read())

        location = None
        for _ in xrange(5):
            location = LocationHelper.get_lat_lng(event['location'])
            if location:
                break
        self.assertAlmostEqual(location[0], 32.7940463, places=6)
        self.assertAlmostEqual(location[1], 34.989571, places=6)
        self.assertEqual(LocationHelper.get_timezone_id(event['location']), 'Asia/Jerusalem')
开发者ID:legoktm,项目名称:the-blue-alliance,代码行数:14,代码来源:test_event_get_timezone_id.py

示例7: test_2005or

# 需要导入模块: from datafeeds.usfirst_event_details_parser import UsfirstEventDetailsParser [as 别名]
# 或者: from datafeeds.usfirst_event_details_parser.UsfirstEventDetailsParser import parse [as 别名]
    def test_2005or(self):
        with open('test_data/usfirst_html/usfirst_event_details_2005or.html', 'r') as f:
            event, _ = UsfirstEventDetailsParser.parse(f.read())

        location = None
        for _ in xrange(5):
            location = LocationHelper.get_lat_lng(event['location'])
            if location:
                break
        self.assertAlmostEqual(location[0], 45.5230622, places=6)
        self.assertAlmostEqual(location[1], -122.6764816, places=6)
        self.assertEqual(LocationHelper.get_timezone_id(event['location']), 'America/Los_Angeles')
开发者ID:legoktm,项目名称:the-blue-alliance,代码行数:14,代码来源:test_event_get_timezone_id.py

示例8: test_parse2001sj

# 需要导入模块: from datafeeds.usfirst_event_details_parser import UsfirstEventDetailsParser [as 别名]
# 或者: from datafeeds.usfirst_event_details_parser.UsfirstEventDetailsParser import parse [as 别名]
    def test_parse2001sj(self):
        with open('test_data/usfirst_html/usfirst_event_details_2001ca2.html', 'r') as f:
            event, _ = UsfirstEventDetailsParser.parse(f.read())

        self.assertEqual(event["name"], "Silicon Valley Regional")
        self.assertEqual(event["event_type_enum"], EventType.REGIONAL)
        self.assertEqual(event["start_date"], datetime.datetime(2001, 3, 22, 0, 0))
        self.assertEqual(event["end_date"], datetime.datetime(2001, 3, 24, 0, 0))
        self.assertEqual(event["year"], 2001)
        self.assertEqual(event["venue_address"], "San Jose, CA\r\nUSA")
        self.assertEqual(event["location"], "San Jose, CA, USA")
        self.assertEqual(event["event_short"], "ca2")
开发者ID:chrismarra,项目名称:the-blue-alliance,代码行数:14,代码来源:test_usfirst_event_details_parser.py

示例9: test_parse2012ct

# 需要导入模块: from datafeeds.usfirst_event_details_parser import UsfirstEventDetailsParser [as 别名]
# 或者: from datafeeds.usfirst_event_details_parser.UsfirstEventDetailsParser import parse [as 别名]
 def test_parse2012ct(self):
     with open('test_data/usfirst_html/usfirst_event_details_2012ct.html', 'r') as f: 
         event = UsfirstEventDetailsParser.parse(f.read())
     
     self.assertEqual(event["name"], "Northeast Utilities FIRST Connecticut Regional")
     self.assertEqual(event["event_type"], "Regional")
     self.assertEqual(event["start_date"], datetime.datetime(2012, 3, 29, 0, 0))
     self.assertEqual(event["end_date"], datetime.datetime(2012, 3, 31, 0, 0))
     self.assertEqual(event["year"], 2012)
     self.assertEqual(event["venue_address"], "Connecticut Convention Center\r\n100 Columbus Blvd\r\nHartford, CT 06103\r\nUSA")
     self.assertEqual(event["website"], "http://www.ctfirst.org/ctr")
     self.assertEqual(event["event_short"], "ct")
开发者ID:dweitz,项目名称:the-blue-alliance,代码行数:14,代码来源:test_usfirst_event_details_parser.py

示例10: test_parse2005is

# 需要导入模块: from datafeeds.usfirst_event_details_parser import UsfirstEventDetailsParser [as 别名]
# 或者: from datafeeds.usfirst_event_details_parser.UsfirstEventDetailsParser import parse [as 别名]
    def test_parse2005is(self):
        with open('test_data/usfirst_html/usfirst_event_details_2005is.html', 'r') as f:
            event, _ = UsfirstEventDetailsParser.parse(f.read())

        self.assertEqual(event["name"], "GM/Technion University Israel Pilot Regional")
        self.assertEqual(event["event_type_enum"], EventType.REGIONAL)
        self.assertEqual(event["start_date"], datetime.datetime(2005, 3, 9, 0, 0))
        self.assertEqual(event["end_date"], datetime.datetime(2005, 3, 9, 0, 0))
        self.assertEqual(event["year"], 2005)
        self.assertEqual(event["venue_address"], "Haifa Sports Coliseum\r\nHaifa, Haifa\r\nIsrael")
        self.assertEqual(event["venue"], "Haifa Sports Coliseum")
        self.assertEqual(event["location"], "Haifa, Haifa, Israel")
        self.assertEqual(event["event_short"], "is")
开发者ID:chrismarra,项目名称:the-blue-alliance,代码行数:15,代码来源:test_usfirst_event_details_parser.py

示例11: test_parse2005or

# 需要导入模块: from datafeeds.usfirst_event_details_parser import UsfirstEventDetailsParser [as 别名]
# 或者: from datafeeds.usfirst_event_details_parser.UsfirstEventDetailsParser import parse [as 别名]
    def test_parse2005or(self):
        with open('test_data/usfirst_html/usfirst_event_details_2005or.html', 'r') as f:
            event, _ = UsfirstEventDetailsParser.parse(f.read())

        self.assertEqual(event["name"], "Pacific Northwest Regional")
        self.assertEqual(event["event_type_enum"], EventType.REGIONAL)
        self.assertEqual(event["start_date"], datetime.datetime(2005, 3, 10, 0, 0))
        self.assertEqual(event["end_date"], datetime.datetime(2005, 3, 12, 0, 0))
        self.assertEqual(event["year"], 2005)
        self.assertEqual(event["venue_address"], "Memorial Coliseum\r\nPortland, OR 97201\r\nUSA")
        self.assertEqual(event["venue"], "Memorial Coliseum")
        self.assertEqual(event["location"], "Portland, OR, USA")
        self.assertEqual(event["event_short"], "or")
开发者ID:chrismarra,项目名称:the-blue-alliance,代码行数:15,代码来源:test_usfirst_event_details_parser.py

示例12: test_parse_1997il

# 需要导入模块: from datafeeds.usfirst_event_details_parser import UsfirstEventDetailsParser [as 别名]
# 或者: from datafeeds.usfirst_event_details_parser.UsfirstEventDetailsParser import parse [as 别名]
    def test_parse_1997il(self):
        with open('test_data/usfirst_html/usfirst_event_details_1997il.html', 'r') as f:
            event, _ = UsfirstEventDetailsParser.parse(f.read())

        self.assertEqual(event["name"], "Motorola Midwest Regional")
        self.assertEqual(event["event_type_enum"], EventType.REGIONAL)
        self.assertEqual(event["start_date"], datetime.datetime(1997, 3, 6, 0, 0))
        self.assertEqual(event["end_date"], datetime.datetime(1997, 3, 8, 0, 0))
        self.assertEqual(event["year"], 1997)
        self.assertEqual(event["venue_address"], "William Rainey Harper College\r\nChicago, IL\r\nUSA")
        self.assertEqual(event["venue"], "William Rainey Harper College")
        self.assertEqual(event["location"], "Chicago, IL, USA")
        self.assertEqual(event["event_short"], "il")
开发者ID:chrismarra,项目名称:the-blue-alliance,代码行数:15,代码来源:test_usfirst_event_details_parser.py

示例13: test_parse2013casj

# 需要导入模块: from datafeeds.usfirst_event_details_parser import UsfirstEventDetailsParser [as 别名]
# 或者: from datafeeds.usfirst_event_details_parser.UsfirstEventDetailsParser import parse [as 别名]
    def test_parse2013casj(self):
        with open('test_data/usfirst_html/usfirst_event_details_2013casj.html', 'r') as f:
            event, _ = UsfirstEventDetailsParser.parse(f.read())

        self.assertEqual(event["name"], "Silicon Valley Regional")
        self.assertEqual(event["event_type_enum"], EventType.REGIONAL)
        self.assertEqual(event["start_date"], datetime.datetime(2013, 4, 4, 0, 0))
        self.assertEqual(event["end_date"], datetime.datetime(2013, 4, 6, 0, 0))
        self.assertEqual(event["year"], 2013)
        self.assertEqual(event["venue_address"], "San Jose State University\r\nThe Event Center\r\nSan Jose, CA 95192\r\nUSA")
        self.assertEqual(event["venue"], "San Jose State University")
        self.assertEqual(event["location"], "San Jose, CA, USA")
        self.assertEqual(event["website"], "http://www.firstsv.org")
        self.assertEqual(event["event_short"], "casj")
开发者ID:chrismarra,项目名称:the-blue-alliance,代码行数:16,代码来源:test_usfirst_event_details_parser.py

示例14: test_2012ct_bad_location

# 需要导入模块: from datafeeds.usfirst_event_details_parser import UsfirstEventDetailsParser [as 别名]
# 或者: from datafeeds.usfirst_event_details_parser.UsfirstEventDetailsParser import parse [as 别名]
 def test_2012ct_bad_location(self):
     with open('test_data/usfirst_html/usfirst_event_details_2012ct.html', 'r') as f:
         event, _ = UsfirstEventDetailsParser.parse(f.read())
     event['location'] = "somewhere on mars"
     self.assertEqual(EventHelper.get_timezone_id(event['location'], '{}{}'.format(event['year'], event['event_short'])), None)
开发者ID:BowlesCR,项目名称:the-blue-alliance,代码行数:7,代码来源:test_event_get_timezone_id.py

示例15: test_1997il

# 需要导入模块: from datafeeds.usfirst_event_details_parser import UsfirstEventDetailsParser [as 别名]
# 或者: from datafeeds.usfirst_event_details_parser.UsfirstEventDetailsParser import parse [as 别名]
    def test_1997il(self):
        with open('test_data/usfirst_html/usfirst_event_details_1997il.html', 'r') as f:
            event, _ = UsfirstEventDetailsParser.parse(f.read())

        self.assertEqual(EventHelper.get_timezone_id(event), 'America/Chicago')
开发者ID:Captain-Dude,项目名称:the-blue-alliance,代码行数:7,代码来源:test_event_get_timezone_id.py


注:本文中的datafeeds.usfirst_event_details_parser.UsfirstEventDetailsParser.parse方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。