コード例 #1
0
 def test_employment_type_missing(self):
     parser = Parser()
     parser.parse(read_test_case('schemaorg-rdfa-employment-type-missing.html'))
     assert parser.get_result('has-employment-type')['result'] == False
コード例 #2
0
    def test_location_missing(self):
        parser = Parser()
        parser.parse(read_test_case('schemaorg-jsonld-location-missing.html')) 
        assert parser.job_advert.address == None

        assert parser.get_result('location-clarity')['result'] == 'missing'
コード例 #3
0
    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
コード例 #4
0
    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'
コード例 #5
0
    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'
コード例 #6
0
 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'
コード例 #7
0
 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'
コード例 #8
0
 def test_parser(self):
     parser = Parser()
     parser.parse(read_test_case('schemaorg-microdata.html'))
     assert parser.get_result('flesch-reading-ease')['result']
コード例 #9
0
 def test_feminine(self):
     parser = Parser()
     parser.parse(read_test_case('schemaorg-microdata-gender-coding-feminine.html'))
     assert 'feminine' in parser.get_result('gender-coded-language')['result']
コード例 #10
0
 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'
コード例 #11
0
 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
コード例 #12
0
 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'