-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #22 from lowks/master
Add test for utils.
- Loading branch information
Showing
1 changed file
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |