Skip to content
This repository has been archived by the owner on Mar 28, 2021. It is now read-only.

Commit

Permalink
coverage improvement on Reply.save_image()
Browse files Browse the repository at this point in the history
  • Loading branch information
thraxil committed Feb 21, 2016
1 parent 61875e9 commit 1416560
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions spokehub/main/tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,10 @@ def test_add_reply_vimeo(self):
self.assertEqual(r.vimeo_id, "foo")


class DummyFile(object):
pass


class ReplyTest(TestCase):
def test_unicode(self):
r = ReplyFactory()
Expand Down Expand Up @@ -131,6 +135,12 @@ def test_link_usernames(self):
u.username, u.username, u2.username, u2.username)
)

def test_save_image_invalid_ext(self):
r = ReplyFactory()
d = DummyFile()
d.name = "invalid.extension"
self.assertIsNone(r.save_image(d))


class NowPostTest(TestCase):
def test_unicode(self):
Expand Down

0 comments on commit 1416560

Please sign in to comment.