示例#1
0
 def test_check_updated_project_field_xml(self):
     change_values(initial_xml_file)
     tree = parse_xml(updated_xml_file)
     root = tree.getroot()
     for elem in root.iter('PROJECT'):
         assert elem.text == 'ABC'
     os.remove(updated_xml_file)
示例#2
0
 def test_check_updated_first_name_field_xml(self):
     change_values(initial_xml_file)
     tree = parse_xml(updated_xml_file)
     root = tree.getroot()
     for elem in root.iter('FIRST_NAME'):
         assert elem.text == 'Ivan'
     os.remove(updated_xml_file)
示例#3
0
 def test_check_updated_first_name_field_json(self):
     change_values(initial_xml_file)
     convert_xml_to_json()
     with open(new_json) as f:
         data = json.load(f)
     assert data["PERSONS"]["PERSON"][0]["FIRST_NAME"] == "Ivan"
示例#4
0
 def test_compare_new_and_expected_json(self):
     change_values(initial_xml_file)
     convert_xml_to_json()
     assert os.path.isfile(new_json)
     assert filecmp.cmp(new_json, expected_json) == True
示例#5
0
 def test_new_json_file_exists(self):
     change_values(initial_xml_file)
     convert_xml_to_json()
     assert os.path.isfile(new_json)
示例#6
0
 def test_negative_compare_updated_and_expected_xml(self):
     change_values(initial_xml_file)
     assert filecmp.cmp(updated_xml_file, initial_xml_file) == False
     os.remove(updated_xml_file)
示例#7
0
 def test_compare_updated_and_expected_xml(self):
     change_values(initial_xml_file)
     assert filecmp.cmp(updated_xml_file, expected_xml_file) == True
     os.remove(updated_xml_file)
示例#8
0
 def test_updated_xml_file_exists(self):
     change_values(initial_xml_file)
     assert os.path.isfile(updated_xml_file)
     os.remove(updated_xml_file)