Skip to content

Commit

Permalink
Quick fix for missing id when no format is provided
Browse files Browse the repository at this point in the history
  • Loading branch information
emi80 committed Oct 16, 2014
1 parent 53137cb commit 6088a87
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion indexfile/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ def export(self, absolute=False, export_type='index', tags=None,
kwargs = {}
kwargs = dict(self.format.items() + kwargs.items())

dsid = kwargs.pop('id', None)
dsid = kwargs.pop('id', 'id')
idxmap = kwargs.pop('map', None)
colsep = kwargs.pop('colsep', '\t')
fileinfo = kwargs.pop('fileinfo', [])
Expand Down
10 changes: 10 additions & 0 deletions test/test_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,16 @@ def test_export_no_map():
assert 'fileinfo' not in exp[0]


def test_export_no_format_no_map():
"""Test export"""
i = Index()
#assert i is not None
i.insert(id="myId", path="test/data/index.txt", type="text", view="TxtFile")
exp = i.export(map=None, export_type='tab', tags=['id'])
assert len(exp) == 1
assert exp[0] == 'myId'


def test_export_no_map_tab_tags_no_miss():
"""Test export without missing values"""
i = Index('test/data/index.txt')
Expand Down

0 comments on commit 6088a87

Please sign in to comment.