Esempio n. 1
0
 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."
Esempio n. 2
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'
Esempio n. 3
0
 def test_description(self):
     parser = Parser()
     parser.parse(read_test_case('schemaorg-microdata.html'))
     assert parser.job_advert.description == """Description:
Esempio n. 4
0
 def test_sentance_too_short_for_flesch_reading_ease(self):
     test_string = "A test"
     assert None == Parser.calculate_flesch_reading_ease(test_string)
Esempio n. 5
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
Esempio n. 6
0
 def test_publishing_format(self):
     parser = Parser()
     parser.parse(read_test_case('schemaorg-rdfa.html'))
     assert parser.job_advert.publishing_format == "rdfa"
Esempio n. 7
0
 def test_invalid_jobPosting_text(self):
     assert False == Parser.has_jobposting(read_test_case('test.txt'))        
Esempio n. 8
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'
Esempio n. 9
0
 def test_valid_jobPosting_rdfa(self):
     assert True == Parser.has_jobposting(read_test_case('schemaorg-rdfa.html'))
Esempio n. 10
0
 def test_invalid_jobPosting_html(self):
     assert False == Parser.has_jobposting(read_test_case('schemaorg-html.html'))
Esempio n. 11
0
 def test_valid_jobPosting_jsonld(self):
     assert True == Parser.has_jobposting(read_test_case('schemaorg-jsonld.html'))
Esempio n. 12
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
Esempio n. 13
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'
Esempio n. 14
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'
Esempio n. 15
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'
Esempio n. 16
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'
Esempio n. 17
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']
Esempio n. 18
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'
Esempio n. 19
0
 def test_parser(self):
     parser = Parser()
     parser.parse(read_test_case('schemaorg-microdata.html'))
     assert parser.get_result('flesch-reading-ease')['result']
Esempio n. 20
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
Esempio n. 21
0
 def test_calculate_flesch_reading_ease(self):
     test_string = "The Australian platypus is seemingly a hybrid of a mammal and reptilian creature"
     assert 49.82 == Parser.calculate_flesch_reading_ease(test_string)
Esempio n. 22
0
 def test_title(self):
     parser = Parser()
     parser.parse(read_test_case('schemaorg-rdfa.html'))
     assert parser.job_advert.title == "Software Engineer"
Esempio n. 23
0
 def test_check_creative_commons_licence_link(self):
     licences = Parser.check_creative_commons_licence(read_test_case('licence-link.html'))
     assert licences == [{'name': 'Creative Commons Attribution', 'url': 'http://creativecommons.org/licenses/by-nd/4.0'}]