Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions qiita_db/software.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ def get_html_generator(cls, artifact_type):
JOIN qiita.software_artifact_type USING (software_id)
JOIN qiita.artifact_type USING (artifact_type_id)
WHERE artifact_type = %s
AND name = 'Generate HTML summary'"""
AND name = 'Generate HTML summary'
AND active = true"""
qdb.sql_connection.TRN.add(sql, [artifact_type])
try:
res = qdb.sql_connection.TRN.execute_fetchlast()
Expand Down Expand Up @@ -139,7 +140,8 @@ def get_validator(cls, artifact_type):
JOIN qiita.software_artifact_type USING (software_id)
JOIN qiita.artifact_type USING (artifact_type_id)
WHERE artifact_type = %s
AND name = 'Validate'"""
AND name = 'Validate'
AND active = true"""
qdb.sql_connection.TRN.add(sql, [artifact_type])
try:
res = qdb.sql_connection.TRN.execute_fetchlast()
Expand Down
26 changes: 20 additions & 6 deletions qiita_db/test/test_software.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,28 +73,42 @@ def test_get_commands_by_input_type(self):
self.assertItemsEqual(obs, exp)

def test_get_html_artifact(self):
obs = qdb.software.Command.get_html_generator('BIOM')
with self.assertRaises(qdb.exceptions.QiitaDBError):
qdb.software.Command.get_html_generator('BIOM')

exp = qdb.software.Command(5)
exp.activate()
obs = qdb.software.Command.get_html_generator('BIOM')
self.assertEqual(obs, exp)

obs = qdb.software.Command.get_html_generator('Demultiplexed')
with self.assertRaises(qdb.exceptions.QiitaDBError):
qdb.software.Command.get_html_generator('Demultiplexed')

exp = qdb.software.Command(7)
exp.activate()
obs = qdb.software.Command.get_html_generator('Demultiplexed')
self.assertEqual(obs, exp)

def test_get_html_artifact_error(self):
with self.assertRaises(qdb.exceptions.QiitaDBError):
qdb.software.Command.get_html_generator('Unknown')

def test_get_validator(self):
obs = qdb.software.Command.get_validator('BIOM')
with self.assertRaises(qdb.exceptions.QiitaDBError):
qdb.software.Command.get_validator('BIOM')

exp = qdb.software.Command(4)
exp.activate()
obs = qdb.software.Command.get_validator('BIOM')
self.assertEqual(obs, exp)

obs = qdb.software.Command.get_validator('Demultiplexed')
with self.assertRaises(qdb.exceptions.QiitaDBError):
qdb.software.Command.get_validator('Demultiplexed')

exp = qdb.software.Command(6)
exp.activate()
obs = qdb.software.Command.get_validator('Demultiplexed')
self.assertEqual(obs, exp)

def test_get_validator_error(self):
with self.assertRaises(qdb.exceptions.QiitaDBError):
qdb.software.Command.get_validator('Unknown')

Expand Down