Skip to content

Commit afc8707

Browse files
committed
Addressing @antgonza comments
1 parent c86d37d commit afc8707

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

qiita_db/handlers/tests/test_plugin.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,5 +186,16 @@ def test_post(self):
186186
self.assertEqual(obs.code, 200)
187187
self.assertTrue(qdb.software.Command(2).active)
188188

189+
190+
class ReloadPluginAPItestHandlerTests(OauthTestingBase):
191+
def test_post_no_header(self):
192+
obs = self.post('/apitest/reload_plugins/', data={})
193+
self.assertEqual(obs.code, 400)
194+
195+
def test_post(self):
196+
obs = self.post('/apitest/reload_plugins/', headers=self.header,
197+
data={})
198+
self.assertEqual(obs.code, 200)
199+
189200
if __name__ == '__main__':
190201
main()

qiita_db/test/test_software.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,20 @@ def test_create(self):
257257
'opt_bool': ['boolean', 'False']}
258258
self.assertEqual(obs.optional_parameters, exp_optional)
259259

260+
obs = qdb.software.Command.create(
261+
self.software, "Test Command 2", "This is a command for testing",
262+
self.parameters)
263+
self.assertEqual(obs.name, "Test Command 2")
264+
self.assertEqual(obs.description, "This is a command for testing")
265+
exp_required = {'req_param': ('string', [None]),
266+
'req_art': ('artifact', ['BIOM'])}
267+
self.assertEqual(obs.required_parameters, exp_required)
268+
exp_optional = {
269+
'opt_int_param': ['integer', '4'],
270+
'opt_choice_param': ['choice:["opt1", "opt2"]', 'opt1'],
271+
'opt_bool': ['boolean', 'False']}
272+
self.assertEqual(obs.optional_parameters, exp_optional)
273+
260274
def test_activate(self):
261275
qdb.software.Software.deactivate_all()
262276
tester = qdb.software.Command(1)

0 commit comments

Comments
 (0)