Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #76 from icgc-dcc/testing
Testing
- Loading branch information
Showing
11 changed files
with
136 additions
and
18 deletions.
There are no files selected for viewing
File renamed without changes.
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
File renamed without changes.
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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
from egasub.submission.submit import submittable_status, submit_dataset, perform_submission | ||
from egasub.ega.entities.ega_enums import EgaEnums | ||
import pytest | ||
import os | ||
|
||
def test_submittable_status(): | ||
assert submittable_status("fail") == None | ||
assert submittable_status("tests/submission/test_submit.py") == [''] | ||
|
||
def test_submit_dataset(ctx, mock_server): | ||
with pytest.raises(AttributeError): | ||
submit_dataset(ctx) | ||
|
||
ctx.obj['SETTINGS']['ega_submitter_account'] = 'test_account' | ||
ctx.obj['SETTINGS']['ega_submitter_password'] = 'test_password' | ||
ctx.obj['SETTINGS']['ega_policy_id'] = 'test_id' | ||
ctx.obj['CURRENT_DIR'] = os.path.join(os.getcwd(), 'tests/data/workspace/variation.20170119') | ||
ctx.obj['EGA_ENUMS'] = EgaEnums() | ||
#ctx.obj['EGA_ENUMS']['_enums'] = '' | ||
with pytest.raises(AttributeError): | ||
submit_dataset(ctx) | ||
|
||
|
||
|
||
|
||
def test_perform_submission(ctx, mock_server): | ||
perform_submission(ctx, '///') | ||
|
||
ctx.obj['SETTINGS']['ega_submitter_account'] = None | ||
ctx.obj['SETTINGS']['ega_submitter_password'] = None | ||
|
||
|
||
|
File renamed without changes.
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
from egasub.submission.submitter import Submitter | ||
import os | ||
import pytest | ||
from egasub.submission.submittable import Unaligned | ||
from egasub.ega.entities.sample import Sample | ||
from egasub.ega.entities.attribute import Attribute | ||
|
||
def test_submitter(ctx, mock_server): | ||
initial_directory = os.getcwd() | ||
os.chdir('tests/data/workspace/unaligned.20170110/') | ||
#unaligned = Unaligned('ssample_y') | ||
os.chdir(initial_directory) | ||
|
||
submitter = Submitter(ctx) | ||
|
||
ctx.obj['SUBMISSION']['sessionToken'] = 'X-Token' | ||
ctx.obj['SETTINGS']['icgc_project_code'] = "abjdh" | ||
#assert submitter.submit(unaligned, True) is None | ||
|
||
attributes = [Attribute('tag1', 'value1'), Attribute('tag2', 'value2')] | ||
sample = Sample('an alias','the title','the description',123,2,'head','test line','test region','a phenotype',33,'anonymized name',22,10,'some details',attributes,33) | ||
with pytest.raises(Exception): | ||
submitter.set_icgc_ids(sample, True) | ||
|
||
|
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
from egasub.ega.entities.ega_enums import EgaEnums | ||
|
||
def test_load_enums(): | ||
e = EgaEnums() | ||
assert len(e.lookup("analysis_types")) == 3 | ||
from egasub.ega.entities.ega_enums import EgaEnums | ||
|
||
def test_load_enums(): | ||
e = EgaEnums() | ||
assert isinstance(e.lookup("analysis_types"), list) |
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 |
---|---|---|
@@ -1,4 +1,3 @@ | ||
|
||
from egasub.submission.init_submission_dir import init_submission_dir | ||
import pytest | ||
|
||
|
This file was deleted.
Oops, something went wrong.