Skip to content

Commit

Permalink
Merge pull request #22 from lowks/master
Browse files Browse the repository at this point in the history
Add test for utils.
  • Loading branch information
solos committed Sep 5, 2015
2 parents 46f52ca + 044231f commit 7a5e72a
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions test/test_utils.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
__author__ = 'lowks'

import unittest
from mock import Mock, patch
import utils


class UtilsTests(unittest.TestCase):

def test_clean_note(self):
utils.cleaner = Mock()
utils.cleaner.clean_html.return_value = "hulahoop"
result = utils.clean_note("hulahoop")
self.assertEqual(result, "hulahoop")

def test_make_mdnote(self):
result = utils.make_mdnote("* hulahoop *")
self.assertEqual(
result, u'<div><ul>\n<li>hulahoop *</li>\n</ul>\n<div style="display:none">* hulahoop *</div></div>')

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

0 comments on commit 7a5e72a

Please sign in to comment.