Skip to content

Commit 6d44366

Browse files
committed
Fixing bug on error report and adding a test for it
1 parent e7bd53a commit 6d44366

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

qiita_db/data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ def create(cls, filetype, prep_templates, filepaths):
327327
"Cannot create raw data because the passed prep templates "
328328
"already have a raw data associated with it. "
329329
"Prep templates: %s"
330-
% ', '.join([pt.id for pt in prep_templates]))
330+
% ', '.join([str(pt.id) for pt in prep_templates]))
331331

332332
# Add the raw data to the database, and get the raw data id back
333333
rd_id = conn_handler.execute_fetchone(

qiita_db/test/test_data.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,10 @@ def test_create(self):
127127
# raw_data_id, filepath_id
128128
self.assertEqual(obs, [[exp_id, top_id - 1], [exp_id, top_id]])
129129

130+
def test_create_error(self):
131+
with self.assertRaises(IncompetentQiitaDeveloperError):
132+
RawData.create(self.filetype, [PrepTemplate(1)], self.filepaths)
133+
130134
def test_get_filepaths(self):
131135
"""Correctly returns the filepaths to the raw files"""
132136
rd = RawData(1)

0 commit comments

Comments
 (0)