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


Python parser.Parser类代码示例

本文整理汇总了Python中jobcert.parser.Parser的典型用法代码示例。如果您正苦于以下问题:Python Parser类的具体用法?Python Parser怎么用?Python Parser使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: test_description

 def test_description(self):
     parser = Parser()
     parser.parse(read_test_case('schemaorg-jsonld.html'))
     assert parser.job_advert.description == "Description: ABC Company Inc. seeks a full-time mid-level software engineer to develop in-house tools."
开发者ID:Doteveryone,项目名称:BetterJobAdverts,代码行数:4,代码来源:parser.py

示例2: test_salary_unclear

 def test_salary_unclear(self):
     parser = Parser()
     parser.parse(read_test_case('schemaorg-jsonld-salary-unclear.html'))
     assert parser.get_result('salary-clarity')['result'] == 'unclear'
开发者ID:Doteveryone,项目名称:BetterJobAdverts,代码行数:4,代码来源:parser.py

示例3: test_sentance_too_short_for_flesch_reading_ease

 def test_sentance_too_short_for_flesch_reading_ease(self):
     test_string = "A test"
     assert None == Parser.calculate_flesch_reading_ease(test_string)
开发者ID:Doteveryone,项目名称:BetterJobAdverts,代码行数:3,代码来源:parser.py

示例4: test_employment_type

    def test_employment_type(self):
        parser = Parser()
        parser.parse(read_test_case('schemaorg-jsonld.html'))
        assert parser.job_advert.employment_type == 'Full-time'

        assert parser.get_result('has-employment-type')['result'] == True
开发者ID:Doteveryone,项目名称:BetterJobAdverts,代码行数:6,代码来源:parser.py

示例5: test_publishing_format

 def test_publishing_format(self):
     parser = Parser()
     parser.parse(read_test_case('schemaorg-rdfa.html'))
     assert parser.job_advert.publishing_format == "rdfa"
开发者ID:Doteveryone,项目名称:BetterJobAdverts,代码行数:4,代码来源:parser.py

示例6: test_invalid_jobPosting_text

 def test_invalid_jobPosting_text(self):
     assert False == Parser.has_jobposting(read_test_case('test.txt'))        
开发者ID:Doteveryone,项目名称:BetterJobAdverts,代码行数:2,代码来源:parser.py

示例7: test_location_clear

    def test_location_clear(self):
        parser = Parser()
        parser.parse(read_test_case('schemaorg-jsonld-location-clear.html')) 
        assert parser.job_advert.address == 'Somerset House, Strand, London WC2R 1LA, London'

        assert parser.get_result('location-clarity')['result'] == 'clear'
开发者ID:Doteveryone,项目名称:BetterJobAdverts,代码行数:6,代码来源:parser.py

示例8: test_valid_jobPosting_rdfa

 def test_valid_jobPosting_rdfa(self):
     assert True == Parser.has_jobposting(read_test_case('schemaorg-rdfa.html'))
开发者ID:Doteveryone,项目名称:BetterJobAdverts,代码行数:2,代码来源:parser.py

示例9: test_invalid_jobPosting_html

 def test_invalid_jobPosting_html(self):
     assert False == Parser.has_jobposting(read_test_case('schemaorg-html.html'))
开发者ID:Doteveryone,项目名称:BetterJobAdverts,代码行数:2,代码来源:parser.py

示例10: test_valid_jobPosting_jsonld

 def test_valid_jobPosting_jsonld(self):
     assert True == Parser.has_jobposting(read_test_case('schemaorg-jsonld.html'))
开发者ID:Doteveryone,项目名称:BetterJobAdverts,代码行数:2,代码来源:parser.py

示例11: test_check_creative_commons_licence_link

 def test_check_creative_commons_licence_link(self):
     parser = Parser()
     parser.parse(read_test_case('licence-link.html'))
     assert parser.job_advert.creative_commons_licences == [{'name': 'Creative Commons Attribution', 'url': 'http://creativecommons.org/licenses/by-nd/4.0'}]
     assert parser.get_result('creative-commons-licence')['result'] == True
开发者ID:Doteveryone,项目名称:BetterJobAdverts,代码行数:5,代码来源:parser.py

示例12: test_salary_clear

 def test_salary_clear(self):
     parser = Parser()
     parser.parse(read_test_case('schemaorg-microdata-salary-clear.html'))
     assert parser.get_result('salary-clarity')['result'] == 'clear'
开发者ID:Doteveryone,项目名称:BetterJobAdverts,代码行数:4,代码来源:parser.py

示例13: test_salary_missing

 def test_salary_missing(self):
     parser = Parser()
     parser.parse(read_test_case('schemaorg-jsonld-salary-missing.html'))
     assert parser.get_result('salary-clarity')['result'] == 'missing'
开发者ID:Doteveryone,项目名称:BetterJobAdverts,代码行数:4,代码来源:parser.py

示例14: test_neutral

 def test_neutral(self):
     parser = Parser()
     parser.parse(read_test_case('schemaorg-microdata-gender-coding-neutral.html'))
     assert parser.get_result('gender-coded-language')['result'] == 'neutral'
开发者ID:Doteveryone,项目名称:BetterJobAdverts,代码行数:4,代码来源:parser.py

示例15: test_location_unclear

    def test_location_unclear(self):
        parser = Parser()
        parser.parse(read_test_case('schemaorg-jsonld.html')) 
        assert parser.job_advert.address == 'Kirkland, WA'

        assert parser.get_result('location-clarity')['result'] == 'unclear'
开发者ID:Doteveryone,项目名称:BetterJobAdverts,代码行数:6,代码来源:parser.py


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