Skip to content
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

Merged
merged 7 commits into from
Oct 13, 2022
Merged

Feature/ted 798 #307

merged 7 commits into from
Oct 13, 2022

Conversation

Mihai10Mihai
Copy link
Contributor

No description provided.

@swarmia
Copy link

swarmia bot commented Oct 13, 2022

"""
first_grath = Graph().parse(FIRST_RML_FILE, format='turtle')
second_grath = Graph().parse(SECOND_RML_FILE, format='turtle')
eq = isomorphic(first_grath, second_grath)
Copy link
Collaborator

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')
Copy link
Collaborator

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
Copy link
Collaborator

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')
Copy link
Collaborator

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')
Copy link
Collaborator

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"
Copy link
Collaborator

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.



@pytest.fixture
def first_rml_file():
Copy link
Collaborator

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"



@pytest.fixture
def second_rml_file():
Copy link
Collaborator

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')
Copy link
Collaborator

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
Copy link
Collaborator

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.

Copy link
Collaborator

@CaptainOfHacks CaptainOfHacks left a 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. 🤠 👍

Copy link
Collaborator

@CaptainOfHacks CaptainOfHacks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job!

@Mihai10Mihai Mihai10Mihai merged commit 8c50ff2 into main Oct 13, 2022
@sonarcloud
Copy link

sonarcloud bot commented Oct 13, 2022

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@Mihai10Mihai Mihai10Mihai deleted the feature/TED-798 branch October 13, 2022 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants