Skip to content

Commit a26d65c

Browse files
committed
LINT: now with flake8
1 parent fffb9ec commit a26d65c

File tree

2 files changed

+145
-129
lines changed

2 files changed

+145
-129
lines changed

qiita_pet/handlers/rest/study_association.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def _set_prep_template(template_payload, prep_template):
9595
current_template[PREP_STATUS] = prep_template.status
9696
current_template[PREP_SAMPLE_METADATA_FILEPATH] = filepath
9797
current_template[PREP_DATA_TYPE] = prep_template.data_type()
98-
current_template[PREP_HUMAN_FILTERING] = _get_human_filtering(prep_template)
98+
current_template[PREP_HUMAN_FILTERING] = _get_human_filtering(prep_template) # noqa
9999

100100
_set_artifacts(current_template, prep_template)
101101

@@ -163,7 +163,7 @@ def _set_artifact_processing(artifact_payload, artifact):
163163

164164
artifact_payload[ARTIFACT_PROCESSING_ID] = artifact_processing_id
165165
artifact_payload[ARTIFACT_PROCESSING_NAME] = artifact_processing_name
166-
artifact_payload[ARTIFACT_PROCESSING_ARGUMENTS] = artifact_processing_arguments
166+
artifact_payload[ARTIFACT_PROCESSING_ARGUMENTS] = artifact_processing_arguments # noqa
167167

168168

169169
def _set_artifact_filepaths(artifact_payload, artifact):

qiita_pet/test/rest/test_study_associations.py

Lines changed: 143 additions & 127 deletions
Original file line numberDiff line numberDiff line change
@@ -18,133 +18,148 @@ def test_get_valid(self):
1818
IGNORE = 'IGNORE'
1919
exp = {'study_id': 1,
2020
'study_sample_metadata_filepath': IGNORE,
21-
'prep_templates': [{'prep_id': 1,
22-
'prep_status': 'private',
23-
'prep_sample_metadata_filepath': IGNORE,
24-
'prep_data_type': '18S',
25-
'prep_human_filtering': 'The greatest human filtering method',
26-
'prep_artifacts': [{'artifact_id': 1,
27-
'artifact_status': 'private',
28-
'artifact_parent_ids': None,
29-
'artifact_basal_id': 1,
30-
'artifact_processing_id': None,
31-
'artifact_processing_name': None,
32-
'artifact_processing_arguments': None,
33-
'artifact_filepaths': [{'artifact_filepath_id': 1,
34-
'artifact_filepath': IGNORE,
35-
'artifact_filepath_type': 'raw_forward_seqs'},
36-
{'artifact_filepath_id': 2,
37-
'artifact_filepath': IGNORE,
38-
'artifact_filepath_type': 'raw_barcodes'}]},
39-
{'artifact_id': 2,
40-
'artifact_status': 'private',
41-
'artifact_parent_ids': [1],
42-
'artifact_basal_id': 1,
43-
'artifact_processing_id': 1,
44-
'artifact_processing_name': 'Split libraries FASTQ',
45-
'artifact_processing_arguments': {'input_data': '1',
46-
'max_bad_run_length': '3',
47-
'min_per_read_length_fraction': '0.75',
48-
'sequence_max_n': '0',
49-
'rev_comp_barcode': 'False',
50-
'rev_comp_mapping_barcodes': 'False',
51-
'rev_comp': 'False',
52-
'phred_quality_threshold': '3',
53-
'barcode_type': 'golay_12',
54-
'max_barcode_errors': '1.5',
55-
'phred_offset': 'auto'},
56-
'artifact_filepaths': [{'artifact_filepath_id': 3,
57-
'artifact_filepath': IGNORE,
58-
'artifact_filepath_type': 'preprocessed_fasta'},
59-
{'artifact_filepath': IGNORE,
60-
'artifact_filepath_id': 4,
61-
'artifact_filepath_type': 'preprocessed_fastq'},
62-
{'artifact_filepath': IGNORE,
63-
'artifact_filepath_id': 5,
64-
'artifact_filepath_type': 'preprocessed_demux'}]},
65-
{'artifact_id': 3,
66-
'artifact_status': 'private',
67-
'artifact_parent_ids': [1],
68-
'artifact_basal_id': 1,
69-
'artifact_processing_id': 1,
70-
'artifact_processing_name': 'Split libraries FASTQ',
71-
'artifact_processing_arguments': {'input_data': '1',
72-
'max_bad_run_length': '3',
73-
'min_per_read_length_fraction': '0.75',
74-
'sequence_max_n': '0',
75-
'rev_comp_barcode': 'False',
76-
'rev_comp_mapping_barcodes': 'True',
77-
'rev_comp': 'False',
78-
'phred_quality_threshold': '3',
79-
'barcode_type': 'golay_12',
80-
'max_barcode_errors': '1.5',
81-
'phred_offset': 'auto'},
82-
'artifact_filepaths': None},
83-
{'artifact_id': 4,
84-
'artifact_status': 'private',
85-
'artifact_parent_ids': [2],
86-
'artifact_basal_id': 1,
87-
'artifact_processing_id': 3,
88-
'artifact_processing_name': 'Pick closed-reference OTUs',
89-
'artifact_processing_arguments': {'input_data': '2',
90-
'reference': '1',
91-
'sortmerna_e_value': '1',
92-
'sortmerna_max_pos': '10000',
93-
'similarity': '0.97',
94-
'sortmerna_coverage': '0.97',
95-
'threads': '1'},
96-
'artifact_filepaths': [{'artifact_filepath_id': 9,
97-
'artifact_filepath': IGNORE,
98-
'artifact_filepath_type': 'biom'}]},
99-
{'artifact_id': 5,
100-
'artifact_status': 'private',
101-
'artifact_parent_ids': [2],
102-
'artifact_basal_id': 1,
103-
'artifact_processing_id': 3,
104-
'artifact_processing_name': 'Pick closed-reference OTUs',
105-
'artifact_processing_arguments': {'input_data': '2',
106-
'reference': '1',
107-
'sortmerna_e_value': '1',
108-
'sortmerna_max_pos': '10000',
109-
'similarity': '0.97',
110-
'sortmerna_coverage': '0.97',
111-
'threads': '1'},
112-
'artifact_filepaths': [{'artifact_filepath_id': 9,
113-
'artifact_filepath': IGNORE,
114-
'artifact_filepath_type': 'biom'}]},
115-
{'artifact_id': 6,
116-
'artifact_status': 'private',
117-
'artifact_parent_ids': [2],
118-
'artifact_basal_id': 1,
119-
'artifact_processing_id': 3,
120-
'artifact_processing_name': 'Pick closed-reference OTUs',
121-
'artifact_processing_arguments': {'input_data': '2',
122-
'reference': '2',
123-
'sortmerna_e_value': '1',
124-
'sortmerna_max_pos': '10000',
125-
'similarity': '0.97',
126-
'sortmerna_coverage': '0.97',
127-
'threads': '1'},
128-
'artifact_filepaths': [{'artifact_filepath_id': 12,
129-
'artifact_filepath': IGNORE,
130-
'artifact_filepath_type': 'biom'}]}]},
131-
{'prep_id': 2,
132-
'prep_status': 'private',
133-
'prep_sample_metadata_filepath': IGNORE,
134-
'prep_data_type': '18S',
135-
'prep_human_filtering': None,
136-
'prep_artifacts': [{'artifact_id': 7,
137-
'artifact_parent_ids': None,
138-
'artifact_basal_id': 7,
139-
'artifact_status': 'private',
140-
'artifact_processing_id': None,
141-
'artifact_processing_name': None,
142-
'artifact_processing_arguments': None,
143-
'artifact_filepaths': [{'artifact_filepath_id': 22,
144-
'artifact_filepath': IGNORE,
145-
'artifact_filepath_type': 'biom'}]}]}]}
21+
'prep_templates': [
22+
{'prep_id': 1,
23+
'prep_status': 'private',
24+
'prep_sample_metadata_filepath': IGNORE,
25+
'prep_data_type': '18S',
26+
'prep_human_filtering': 'The greatest human filtering method', # noqa
27+
'prep_artifacts': [
28+
{'artifact_id': 1,
29+
'artifact_status': 'private',
30+
'artifact_parent_ids': None,
31+
'artifact_basal_id': 1,
32+
'artifact_processing_id': None,
33+
'artifact_processing_name': None,
34+
'artifact_processing_arguments': None,
35+
'artifact_filepaths': [
36+
{'artifact_filepath_id': 1,
37+
'artifact_filepath': IGNORE,
38+
'artifact_filepath_type': 'raw_forward_seqs'},
39+
{'artifact_filepath_id': 2,
40+
'artifact_filepath': IGNORE,
41+
'artifact_filepath_type': 'raw_barcodes'}]},
42+
{'artifact_id': 2,
43+
'artifact_status': 'private',
44+
'artifact_parent_ids': [1],
45+
'artifact_basal_id': 1,
46+
'artifact_processing_id': 1,
47+
'artifact_processing_name': 'Split libraries FASTQ',
48+
'artifact_processing_arguments': {
49+
'input_data': '1',
50+
'max_bad_run_length': '3',
51+
'min_per_read_length_fraction': '0.75',
52+
'sequence_max_n': '0',
53+
'rev_comp_barcode': 'False',
54+
'rev_comp_mapping_barcodes': 'False',
55+
'rev_comp': 'False',
56+
'phred_quality_threshold': '3',
57+
'barcode_type': 'golay_12',
58+
'max_barcode_errors': '1.5',
59+
'phred_offset': 'auto'},
60+
'artifact_filepaths': [
61+
{'artifact_filepath_id': 3,
62+
'artifact_filepath': IGNORE,
63+
'artifact_filepath_type': 'preprocessed_fasta'},
64+
{'artifact_filepath': IGNORE,
65+
'artifact_filepath_id': 4,
66+
'artifact_filepath_type': 'preprocessed_fastq'},
67+
{'artifact_filepath': IGNORE,
68+
'artifact_filepath_id': 5,
69+
'artifact_filepath_type': 'preprocessed_demux'}]},
70+
{'artifact_id': 3,
71+
'artifact_status': 'private',
72+
'artifact_parent_ids': [1],
73+
'artifact_basal_id': 1,
74+
'artifact_processing_id': 1,
75+
'artifact_processing_name': 'Split libraries FASTQ',
76+
'artifact_processing_arguments': {
77+
'input_data': '1',
78+
'max_bad_run_length': '3',
79+
'min_per_read_length_fraction': '0.75',
80+
'sequence_max_n': '0',
81+
'rev_comp_barcode': 'False',
82+
'rev_comp_mapping_barcodes': 'True',
83+
'rev_comp': 'False',
84+
'phred_quality_threshold': '3',
85+
'barcode_type': 'golay_12',
86+
'max_barcode_errors': '1.5',
87+
'phred_offset': 'auto'},
88+
'artifact_filepaths': None},
89+
{'artifact_id': 4,
90+
'artifact_status': 'private',
91+
'artifact_parent_ids': [2],
92+
'artifact_basal_id': 1,
93+
'artifact_processing_id': 3,
94+
'artifact_processing_name': 'Pick closed-reference OTUs',
95+
'artifact_processing_arguments': {
96+
'input_data': '2',
97+
'reference': '1',
98+
'sortmerna_e_value': '1',
99+
'sortmerna_max_pos': '10000',
100+
'similarity': '0.97',
101+
'sortmerna_coverage': '0.97',
102+
'threads': '1'},
103+
'artifact_filepaths': [{
104+
'artifact_filepath_id': 9,
105+
'artifact_filepath': IGNORE,
106+
'artifact_filepath_type': 'biom'}]},
107+
{'artifact_id': 5,
108+
'artifact_status': 'private',
109+
'artifact_parent_ids': [2],
110+
'artifact_basal_id': 1,
111+
'artifact_processing_id': 3,
112+
'artifact_processing_name': 'Pick closed-reference OTUs',
113+
'artifact_processing_arguments': {
114+
'input_data': '2',
115+
'reference': '1',
116+
'sortmerna_e_value': '1',
117+
'sortmerna_max_pos': '10000',
118+
'similarity': '0.97',
119+
'sortmerna_coverage': '0.97',
120+
'threads': '1'},
121+
'artifact_filepaths': [{
122+
'artifact_filepath_id': 9,
123+
'artifact_filepath': IGNORE,
124+
'artifact_filepath_type': 'biom'}]},
125+
{'artifact_id': 6,
126+
'artifact_status': 'private',
127+
'artifact_parent_ids': [2],
128+
'artifact_basal_id': 1,
129+
'artifact_processing_id': 3,
130+
'artifact_processing_name': 'Pick closed-reference OTUs',
131+
'artifact_processing_arguments': {
132+
'input_data': '2',
133+
'reference': '2',
134+
'sortmerna_e_value': '1',
135+
'sortmerna_max_pos': '10000',
136+
'similarity': '0.97',
137+
'sortmerna_coverage': '0.97',
138+
'threads': '1'},
139+
'artifact_filepaths': [{
140+
'artifact_filepath_id': 12,
141+
'artifact_filepath': IGNORE,
142+
'artifact_filepath_type': 'biom'}]}]},
143+
{'prep_id': 2,
144+
'prep_status': 'private',
145+
'prep_sample_metadata_filepath': IGNORE,
146+
'prep_data_type': '18S',
147+
'prep_human_filtering': None,
148+
'prep_artifacts': [{
149+
'artifact_id': 7,
150+
'artifact_parent_ids': None,
151+
'artifact_basal_id': 7,
152+
'artifact_status': 'private',
153+
'artifact_processing_id': None,
154+
'artifact_processing_name': None,
155+
'artifact_processing_arguments': None,
156+
'artifact_filepaths': [{
157+
'artifact_filepath_id': 22,
158+
'artifact_filepath': IGNORE,
159+
'artifact_filepath_type': 'biom'}]}]}]}
146160

147-
response = self.get('/api/v1/study/1/associations', headers=self.headers)
161+
response = self.get('/api/v1/study/1/associations',
162+
headers=self.headers)
148163
self.assertEqual(response.code, 200)
149164
obs = json_decode(response.body)
150165

@@ -173,7 +188,8 @@ def _process_list(list_):
173188
self.assertEqual(obs, exp)
174189

175190
def test_get_invalid(self):
176-
response = self.get('/api/v1/study/0/associations', headers=self.headers)
191+
response = self.get('/api/v1/study/0/associations',
192+
headers=self.headers)
177193
self.assertEqual(response.code, 404)
178194

179195

0 commit comments

Comments
 (0)