|
|
|
@ -84,3 +84,32 @@ class TestParsingMethods:
|
|
|
|
|
template = document_1_object.make_template(document_2_object)
|
|
|
|
|
document_1_object.join_template(template)
|
|
|
|
|
assert document_1_object.document_text == document_2
|
|
|
|
|
|
|
|
|
|
def test_json_join_with_unicode_symbols(self):
|
|
|
|
|
original_text = '''{
|
|
|
|
|
"Description[cs]": "Upravit hlasitost zařízení a aplikací",
|
|
|
|
|
"Description[da]": "Justér lydstyrke for enheder og programmer",
|
|
|
|
|
"Description[de]": "Anpassung der Lautstärke von Geräten und Anwendungen",
|
|
|
|
|
"Description[el]": "Προσαρμογή της έντασης των συσκευών και εφαρμογών",
|
|
|
|
|
"test": "true"
|
|
|
|
|
}
|
|
|
|
|
'''
|
|
|
|
|
|
|
|
|
|
template_text = '''{
|
|
|
|
|
"test": "false"
|
|
|
|
|
}
|
|
|
|
|
'''
|
|
|
|
|
|
|
|
|
|
join_result = '''{
|
|
|
|
|
"Description[cs]": "Upravit hlasitost zařízení a aplikací",
|
|
|
|
|
"Description[da]": "Justér lydstyrke for enheder og programmer",
|
|
|
|
|
"Description[de]": "Anpassung der Lautstärke von Geräten und Anwendungen",
|
|
|
|
|
"Description[el]": "Προσαρμογή της έντασης των συσκευών και εφαρμογών",
|
|
|
|
|
"test": "false"
|
|
|
|
|
}
|
|
|
|
|
'''
|
|
|
|
|
|
|
|
|
|
original_object = JSONFormat(original_text, '/path/to/template')
|
|
|
|
|
template_object = JSONFormat(template_text, '/path/to/template')
|
|
|
|
|
original_object.join_template(template_object)
|
|
|
|
|
assert original_object.document_text == join_result
|
|
|
|
|