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

fix: xml validation (DEV-1360) #230

Merged
merged 5 commits into from Sep 23, 2022
Merged

Conversation

jnussbaum
Copy link
Collaborator

resolves DEV-1360

@jnussbaum jnussbaum self-assigned this Sep 21, 2022
@jnussbaum jnussbaum changed the title fix: XML validation (DEV-1360) fix: xml validation (DEV-1360) Sep 21, 2022

def test_get(self) -> None:

def test_create_lists(self) -> None:
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This test is new

Comment on lines -159 to -169
def test_excel_to_json_list(self) -> None:
excel_to_json_lists.excel2lists(excelfolder='testdata/lists_multilingual',
path_to_output_file='testdata/tmp/_lists-out.json')

def test_excel_to_json_resources(self) -> None:
excel2resources(excelfile='testdata/Resources.xlsx',
path_to_output_file='testdata/tmp/_out_resources.json')

def test_excel_to_json_properties(self) -> None:
excel2properties(excelfile='testdata/Properties.xlsx',
path_to_output_file='testdata/tmp/_out_properties.json')
Copy link
Collaborator Author

@jnussbaum jnussbaum Sep 23, 2022

Choose a reason for hiding this comment

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

I moved these three to the end, so that the file is ordered according the order in dsp_tools.py

excel2properties(excelfile='testdata/Properties.xlsx',
path_to_output_file='testdata/tmp/_out_properties.json')
def test_validate_xml_against_schema(self) -> None:
self.assertTrue(validate_xml_against_schema(self.test_data_systematic_file))
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

new

Copy link
Collaborator

Choose a reason for hiding this comment

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

as above

Comment on lines +112 to +121
def test_create_project(self) -> None:
result = create_project(
input_file=self.test_project_systematic_file,
server=self.server,
user_mail=self.user,
password="test",
verbose=True,
dump=False
)
self.assertTrue(result)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

moved here from further down, so that the order is according to dsp_tools.py



def test_validate_project(self) -> None:
self.assertTrue(validate_project(self.test_project_systematic_file))
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

new

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ideally, you would always test for the failure case too (even better, if you can test different failing scenarios).

Copy link
Collaborator

@BalduinLandolt BalduinLandolt left a comment

Choose a reason for hiding this comment

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

LGTM

test/e2e/test_tools.py Outdated Show resolved Hide resolved


def test_validate_project(self) -> None:
self.assertTrue(validate_project(self.test_project_systematic_file))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Ideally, you would always test for the failure case too (even better, if you can test different failing scenarios).

excel2properties(excelfile='testdata/Properties.xlsx',
path_to_output_file='testdata/tmp/_out_properties.json')
def test_validate_xml_against_schema(self) -> None:
self.assertTrue(validate_xml_against_schema(self.test_data_systematic_file))
Copy link
Collaborator

Choose a reason for hiding this comment

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

as above

Copy link

@irinaschubert irinaschubert left a comment

Choose a reason for hiding this comment

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

LGTM, I agree with Balduin that also negative outputs / cases should be tested.

Copy link

@irinaschubert irinaschubert left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Collaborator

@BalduinLandolt BalduinLandolt left a comment

Choose a reason for hiding this comment

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

LGTM. I can imagine there are more ways how the XML upload could fail. But it's a step in the right direction!

@jnussbaum jnussbaum merged commit 0b2bd40 into main Sep 23, 2022
@jnussbaum jnussbaum deleted the wip/dev-1360-fix-validate-xml branch September 23, 2022 11:29
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.

None yet

3 participants