Skip to content

Commit

Permalink
dataset(readme): first pass at handling null readme
Browse files Browse the repository at this point in the history
  • Loading branch information
uhLeeshUh committed Sep 4, 2020
1 parent 4c1a63c commit 286b8bb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion qri/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def render(self):
return markdown.markdown(self.script)

def __repr__(self):
return self.script
return self.script or ''

def _repr_html_(self):
return self.render()
Expand Down
5 changes: 5 additions & 0 deletions tests/client_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ def test_client_get(self):
self.assertEqual(str(ds), expect)
self.assertEqual(ds.structure.format, 'csv')

def test_client_get_readme(self):
ds = client.get('me/first_dataset')
readme = ds.readme
self.assertEqual(str(readme), '')


if __name__ == '__main__':
unittest.main()

0 comments on commit 286b8bb

Please sign in to comment.