-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* rm key * use test_ssh_key * flake8 * add chmod * ssh_key -> ssh_key_fp * fix #3057 * adding JS for download * minor improvements * addressing @ElDeveloper comment * fix #3049 * fix #3060 * flake8 * addressing @ElDeveloper comments * Delete 81.sql * No * Yes * No * Yes * Replace qiita-spots to qiita Co-authored-by: Antonio Gonzalez <[email protected]>
- Loading branch information
1 parent
8fb9ca0
commit 30d7f5e
Showing
17 changed files
with
215 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -257,6 +257,22 @@ def test_artifact_summary_get_request(self): | |
'errored_summary_jobs': []} | ||
self.assertEqual(obs, exp) | ||
|
||
# the buttons shouldn't be present when the study is autoloaded | ||
study = a.study | ||
study.autoloaded = True | ||
exp['buttons'] = ('<button onclick="if (confirm(\'Are you sure you ' | ||
'want to make public artifact id: 2?\')) { ' | ||
'set_artifact_visibility(\'public\', 2) }" ' | ||
'class="btn btn-primary btn-sm">Make public' | ||
'</button> <button onclick="if (confirm(\'Are you ' | ||
'sure you want to revert to sandbox artifact id: ' | ||
'2?\')) { set_artifact_visibility(\'sandbox\', 2) ' | ||
'}" class="btn btn-primary btn-sm">Revert to ' | ||
'sandbox</button> ' + private_download_button % 2) | ||
obs = artifact_summary_get_request(User('[email protected]'), 2) | ||
self.assertEqual(obs, exp) | ||
study.autoloaded = False | ||
|
||
# analysis artifact | ||
obs = artifact_summary_get_request(user, 8) | ||
exp = {'name': 'noname', | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,12 +6,14 @@ | |
# The full license is in the file LICENSE, distributed with this software. | ||
# ----------------------------------------------------------------------------- | ||
|
||
import pandas as pd | ||
from unittest import main | ||
from mock import Mock | ||
from os.path import exists, isdir, join, basename | ||
from os import remove, makedirs, close | ||
from shutil import rmtree | ||
from tempfile import mkdtemp, mkstemp | ||
from io import StringIO | ||
|
||
from biom.util import biom_open | ||
from biom import example_table as et | ||
|
@@ -340,6 +342,25 @@ def test_download(self): | |
self.assertEqual(response.code, 405) | ||
|
||
|
||
class TestDownloadSampleInfoPerPrep(TestHandlerBase): | ||
|
||
def test_download(self): | ||
# check success | ||
response = self.get('/download_sample_info_per_prep/1') | ||
self.assertEqual(response.code, 200) | ||
|
||
df = pd.read_csv(StringIO(response.body.decode('ascii')), sep='\t') | ||
# just testing shape as the actual content is tested in the dataframe | ||
# generation | ||
self.assertEqual(df.shape, (27, 33)) | ||
|
||
# changing user so we can test the failures | ||
BaseHandler.get_current_user = Mock( | ||
return_value=User("[email protected]")) | ||
response = self.get('/download_sample_info_per_prep/1') | ||
self.assertEqual(response.code, 405) | ||
|
||
|
||
class TestDownloadUpload(TestHandlerBase): | ||
|
||
def test_download(self): | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.