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

Add "create" tag for sheet versions & Add tests for templatetags #1728

Merged
merged 8 commits into from
Aug 15, 2023

Conversation

gromdimon
Copy link
Collaborator

@gromdimon gromdimon commented Jul 13, 2023

Issue #1296

TODO:

  • Implement
  • Test
  • Cleanup
  • Docs

@gromdimon gromdimon linked an issue Jul 13, 2023 that may be closed by this pull request
@gromdimon gromdimon marked this pull request as ready for review July 13, 2023 15:53
@gromdimon
Copy link
Collaborator Author

gromdimon commented Jul 17, 2023

Another Issue: #1723

TODO:

  • Implement test

btw: I found an interesting approach to avoid imports of IrodsRequest and ISATab - just mocking them. I hope it works fine, if not - let me know and I will reimplement them.

@gromdimon gromdimon linked an issue Jul 17, 2023 that may be closed by this pull request
@gromdimon gromdimon changed the title Add "create" tag for sheet versions Add "create" tag for sheet versions & Add tests for templatetags Jul 17, 2023
Copy link
Contributor

@mikkonie mikkonie left a comment

Choose a reason for hiding this comment

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

Looks good and works just as expected, good work. I have some requests for changes, mainly related to style issues.

These should preferably have been two separate PRs as they are not related in any other way than belonging in the same app, but it's not a big deal since it's not a huge PR.

samplesheets/tests/test_templatetags.py Outdated Show resolved Hide resolved
samplesheets/tests/test_templatetags.py Outdated Show resolved Hide resolved
samplesheets/tests/test_templatetags.py Outdated Show resolved Hide resolved
samplesheets/tests/test_templatetags.py Outdated Show resolved Hide resolved
samplesheets/tests/test_views.py Outdated Show resolved Hide resolved
@gromdimon gromdimon force-pushed the 1296-add-create-tag-for-sheet-versions branch from 1ecf6a1 to 666d17b Compare August 10, 2023 08:16
Copy link
Contributor

@mikkonie mikkonie left a comment

Choose a reason for hiding this comment

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

A couple of minor notes, can merge after these have been handled.

samplesheets/tests/test_templatetags.py Outdated Show resolved Hide resolved
samplesheets/tests/test_templatetags.py Outdated Show resolved Hide resolved
Copy link
Contributor

@mikkonie mikkonie left a comment

Choose a reason for hiding this comment

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

Reviewed, had one comment.

# Assert that study path exists in the returned string
self.assertIn(self.irods_backend.get_sub_path(self.study), ret)
# Assert that assay path exists in the returned string
path0, path1 = self.irods_backend.get_sub_path(self.assay).split('/')
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure if I understand what happens here. You split the same path into two parts and then assert both of them are found in the return data. Why not just assert the inclusion of the full path?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The reason for that is response. It is html, which is formed with tags:
<ul><li>sample_data<ul><li>study_dff42df4-362a-460c-86cf-749897eb6190<ul><li>assay_f9fb2c7d-9541-4a44-a8a3-0bbaebfdb7ce</li></ul></li></ul></li></ul>
So I've splited path and asserted it separately, as it was the simplest solution :)

Copy link
Contributor

@mikkonie mikkonie left a comment

Choose a reason for hiding this comment

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

Looks good, will merge.

@mikkonie mikkonie merged commit f7cfd4b into dev Aug 15, 2023
3 checks passed
@mikkonie mikkonie deleted the 1296-add-create-tag-for-sheet-versions branch August 15, 2023 08:09
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.

Add samplesheets template tag tests Add "create" tag for sheet versions
2 participants