-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/ted 798 #307
Feature/ted 798 #307
Conversation
✅ Linked to TED-798 · create the component and the RDF diffing service |
""" | ||
first_grath = Graph().parse(FIRST_RML_FILE, format='turtle') | ||
second_grath = Graph().parse(SECOND_RML_FILE, format='turtle') | ||
eq = isomorphic(first_grath, second_grath) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use vars name more semantically, instead of "eq" use "is_equal_graphs" or "check_graph_equality".
<h2>{{difference in the second file}}</h2> | ||
<p>{second.serialize(format="nt")}</p> | ||
</body>''' | ||
rezult = open('differences_between_files.html', 'w') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename "rezult" to "result" and use more semantically naming for vars. You can use a var name like "report_result_file"
rezult = open('differences_between_files.html', 'w') | ||
rezult.write(html_report) | ||
rezult.close() | ||
return rezult |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why you return a file reference "rezult" ?
<h2>{{difference in the second file}}</h2> | ||
<p>{second.serialize(format="nt")}</p> | ||
</body>''' | ||
rezult = open('differences_between_files.html', 'w') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why result file path is constant ? "differences_between_files.html", service work only with one result file ? or can write result in variable path?
check whether they represent the same graph. | ||
""" | ||
first_grath = Graph().parse(FIRST_RML_FILE, format='turtle') | ||
second_grath = Graph().parse(SECOND_RML_FILE, format='turtle') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Constant format ? I suggest to replace constant format with a variable.
from tests import TEST_DATA_PATH | ||
|
||
FIRST_RML_FILE = TEST_DATA_PATH / "technical_mapping_F03.rml.ttl" | ||
SECOND_RML_FILE = TEST_DATA_PATH / "technical_mapping_F06.rml.ttl" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this constants need to be removed from here.
tests/e2e/rdf_differ/conftest.py
Outdated
|
||
|
||
@pytest.fixture | ||
def first_rml_file(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename fixture name with "technical_mapping_f03_file_path"
tests/e2e/rdf_differ/conftest.py
Outdated
|
||
|
||
@pytest.fixture | ||
def second_rml_file(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename fixture name with "technical_mapping_f06_file_path"
|
||
def test_rdf_differ_service(first_rml_file, second_rml_file): | ||
differences_between_files = rdf_differ_service(first_rml_file, second_rml_file) | ||
file = open(f"{differences_between_files.name}", "r", encoding='utf-8') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refactor this test after implement comments above.
def test_rdf_differ_service(first_rml_file, second_rml_file): | ||
differences_between_files = rdf_differ_service(first_rml_file, second_rml_file) | ||
file = open(f"{differences_between_files.name}", "r", encoding='utf-8') | ||
assert len(file.read()) > 10 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why len(file.read()) > 10 ? Use another assert, more practically.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resolve comments and request re-review. 🤠 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job!
SonarCloud Quality Gate failed. |
No description provided.