Skip to content

Commit

Permalink
minor cleanup (#1529)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikkonie committed Feb 1, 2023
1 parent 3440d1b commit 1e67f2a
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 21 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ Added
- ``get_zone_path()`` helper (#1399)
- ``get_user_group_name()`` helper (#1397)
- ``get_ticket()`` method
- **Landingzones***
- **Landingzones**
- ``LandingZone.can_display_files()`` helper (#1401)
- **Samplesheets**
- Statistics badge in iRODS dir modal (#1434)
Expand Down
8 changes: 4 additions & 4 deletions samplesheets/tests/test_permissions_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,13 @@ def test_get_archive(self):
self.assert_response_api(url, self.anonymous, 401)


class TestSampleSheetImportAPIView(
class TestSheetImportAPIView(
SampleSheetIOMixin,
RemoteSiteMixin,
RemoteProjectMixin,
TestProjectAPIPermissionBase,
):
"""Tests for SampleSheetImportAPIView permissions"""
"""Tests for SheetImportAPIView permissions"""

def _cleanup_import(self):
self.zip_file.seek(0)
Expand Down Expand Up @@ -256,13 +256,13 @@ def test_post_archive(self):
)


class TestSampleSheetISAExportAPIView(
class TestSheetISAExportAPIView(
SampleSheetIOMixin,
RemoteSiteMixin,
RemoteProjectMixin,
TestProjectAPIPermissionBase,
):
"""Tests for SampleSheetISAExportAPIView permissions"""
"""Tests for SheetISAExportAPIView permissions"""

def setUp(self):
super().setUp()
Expand Down
23 changes: 8 additions & 15 deletions samplesheets/tests/test_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
from samplesheets.views_ajax import ALERT_ACTIVE_REQS


# App settings API
app_settings = AppSettingAPI()


Expand Down Expand Up @@ -168,15 +167,14 @@ def setUp(self):
self._setup_investigation()

def test_render(self):
"""Test rendering the view with study and assay grids"""
"""Test rendering view with study and assay grids"""
users = [
self.superuser,
self.user_owner,
self.user_delegate,
self.user_contributor,
self.user_guest,
]

for user in users:
self._login_and_render(user=user, wait_elem='sodar-ss-grid-study')
# Ensure assay grid is found (we already know study is there)
Expand All @@ -191,7 +189,7 @@ def test_render(self):
self.selenium.find_element(By.ID, 'sodar-ss-alert-error')

def test_render_no_sheet(self):
"""Test rendering the view with no sheet"""
"""Test rendering view with no sheet"""
self.investigation.delete()
users = [
self.superuser,
Expand All @@ -200,7 +198,6 @@ def test_render_no_sheet(self):
self.user_contributor,
self.user_guest,
]

for user in users:
self._login_and_render(user)
# Ensure alert is shown
Expand All @@ -215,7 +212,7 @@ def test_render_no_sheet(self):
)

def test_render_alert(self):
"""Test rendering an alert retrieved from SODAR context"""
"""Test rendering alert retrieved from SODAR context"""
# NOTE: Testing here as we don't (yet) have vue tests for entire app
irods_backend = get_backend_api('omics_irods')
self.investigation.irods_status = True
Expand All @@ -233,7 +230,6 @@ def test_render_alert(self):
self.user_contributor,
self.user_guest,
]

for user in users:
self._login_and_render(user=user, wait_elem='sodar-ss-grid-study')
if user in [
Expand Down Expand Up @@ -342,7 +338,7 @@ def setUp(self):
)

def test_render_form(self):
"""Test UI rendering for form"""
"""Test UI rendering for iRODS request create view"""
self.assert_element_exists(
[self.default_user], self.url, 'sodar-ss-btn-import-submit', True
)
Expand Down Expand Up @@ -371,7 +367,7 @@ def setUp(self):
)

def test_render_form(self):
"""Test UI rendering for form"""
"""Test UI rendering for iRODS request update view"""
self.assert_element_exists(
[self.default_user], self.url, 'sodar-ss-btn-import-submit', True
)
Expand Down Expand Up @@ -400,8 +396,8 @@ def setUp(self):
)

def test_render(self):
"""Test UI rendering for form"""

"""Test UI rendering for iRODS request delete view"""
"""Test UI rendering for iRODS request delete view"""
self.assert_element_exists(
[self.default_user], self.url, 'sodar-ss-btn-confirm-delete', True
)
Expand Down Expand Up @@ -430,8 +426,7 @@ def setUp(self):
)

def test_render(self):
"""Test UI rendering for confirm accept page"""

"""Test UI rendering for iRODS request accept view"""
self.assert_element_exists(
[self.superuser], self.url, 'sodar-ss-btn-delete-submit', True
)
Expand Down Expand Up @@ -476,7 +471,6 @@ def setUp(self):
self.import_isa_from_file(SHEET_PATH_SMALL2, self.project)
self.assertEqual(Investigation.objects.count(), 1)
self.assertEqual(ISATab.objects.count(), 1)

self.isa1 = ISATab.objects.first()
self.url = '{}?source={}&target={}'.format(
reverse(
Expand Down Expand Up @@ -515,7 +509,6 @@ def setUp(self):
self.import_isa_from_file(SHEET_PATH_SMALL2, self.project)
self.assertEqual(Investigation.objects.count(), 1)
self.assertEqual(ISATab.objects.count(), 1)

self.isa1 = ISATab.objects.first()
self.url_study_file = (
reverse(
Expand Down
1 change: 0 additions & 1 deletion samplesheets/tests/test_views_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@
SHEET_PATH = SHEET_DIR + 'i_small2.zip'
SHEET_PATH_EDITED = SHEET_DIR + 'i_small2_edited.zip'
SHEET_NAME_ALT = 'i_small.zip'
SHEET_PATH_ALT = SHEET_DIR + SHEET_NAME_ALT
SHEET_PATH_ALT = SHEET_DIR + 'i_small2_alt.zip'
SHEET_PATH_NO_PLUGIN_ASSAY = SHEET_DIR_SPECIAL + 'i_small_assay_no_plugin.zip'
IRODS_FILE_MD5 = '0b26e313ed4a7ca6904b0e9369e5b957'
Expand Down

0 comments on commit 1e67f2a

Please sign in to comment.