Exemplo n.º 1
0
    def test_returned_education_job_map_dict_should_have_mapping_for_all_xml_resumes(
            self):
        returned_education_job_map_dict = extract_features_for_network_map(
            self.xml_file_directory, False)
        path, dirs, files = next(os.walk(self.xml_file_directory))

        assert_equals(len(files), len(returned_education_job_map_dict))
    def test_job_title_should_match_in_returned_dict_and_xml_file(self):
        returned_education_job_map_dict = extract_features_for_network_map(self.xml_file_directory, False)
        xml_file_name = "1.txt"
        title_from_returned_dict = returned_education_job_map_dict["1"][0][10]

        xml = etree.parse(self.xml_file_directory + '/' + xml_file_name)
        title_from_xml = xml.xpath("//title/text()")[0]

        assert_equals(title_from_returned_dict, title_from_xml)
    def test_major_code_should_match_in_returned_dict_and_xml_file(self):
        returned_education_job_map_dict = extract_features_for_network_map(self.xml_file_directory, False)
        xml_file_name = "1.txt"
        major_code_from_returned_dict = returned_education_job_map_dict["1"][0][5]

        xml = etree.parse(self.xml_file_directory + '/' + xml_file_name)
        major_code_from_xml = xml.xpath("//major/@code")[0]

        assert_equals(major_code_from_returned_dict, major_code_from_xml)
    def test_university_name_should_match_in_returned_dict_and_xml_file(self):
        returned_education_job_map_dict = extract_features_for_network_map(self.xml_file_directory, False)
        xml_file_name = "1.txt"
        university_from_returned_dict = returned_education_job_map_dict["1"][0][2]

        xml = etree.parse(self.xml_file_directory + '/' + xml_file_name)
        university_from_xml = xml.xpath("//institution/text()")[0]

        assert_equals(university_from_returned_dict, university_from_xml)
Exemplo n.º 5
0
    def test_job_title_should_match_in_returned_dict_and_xml_file(self):
        returned_education_job_map_dict = extract_features_for_network_map(
            self.xml_file_directory, False)
        xml_file_name = "1.txt"
        title_from_returned_dict = returned_education_job_map_dict["1"][0][10]

        xml = etree.parse(self.xml_file_directory + '/' + xml_file_name)
        title_from_xml = xml.xpath("//title/text()")[0]

        assert_equals(title_from_returned_dict, title_from_xml)
Exemplo n.º 6
0
    def test_major_code_should_match_in_returned_dict_and_xml_file(self):
        returned_education_job_map_dict = extract_features_for_network_map(
            self.xml_file_directory, False)
        xml_file_name = "1.txt"
        major_code_from_returned_dict = returned_education_job_map_dict["1"][
            0][5]

        xml = etree.parse(self.xml_file_directory + '/' + xml_file_name)
        major_code_from_xml = xml.xpath("//major/@code")[0]

        assert_equals(major_code_from_returned_dict, major_code_from_xml)
Exemplo n.º 7
0
    def test_university_name_should_match_in_returned_dict_and_xml_file(self):
        returned_education_job_map_dict = extract_features_for_network_map(
            self.xml_file_directory, False)
        xml_file_name = "1.txt"
        university_from_returned_dict = returned_education_job_map_dict["1"][
            0][2]

        xml = etree.parse(self.xml_file_directory + '/' + xml_file_name)
        university_from_xml = xml.xpath("//institution/text()")[0]

        assert_equals(university_from_returned_dict, university_from_xml)
Exemplo n.º 8
0
    def test_should_return_an_empty_dict_for_invalid_xml_directory(self):
        xml_directory = self.current_file_directory + '/invalid_path/'
        returned_education_job_map_dict = extract_features_for_network_map(
            xml_directory, False)

        assert_equals({}, returned_education_job_map_dict)
    def test_returned_education_job_map_dict_should_have_mapping_for_all_xml_resumes(self):
        returned_education_job_map_dict = extract_features_for_network_map(self.xml_file_directory, False)
        path, dirs, files = next(os.walk(self.xml_file_directory))

        assert_equals(len(files), len(returned_education_job_map_dict))
    def test_should_return_an_empty_dict_for_invalid_xml_directory(self):
        xml_directory = self.current_file_directory + '/invalid_path/'
        returned_education_job_map_dict = extract_features_for_network_map(xml_directory, False)

        assert_equals({}, returned_education_job_map_dict)