From 62262be5f2540a520812db410c8a2553a35813d7 Mon Sep 17 00:00:00 2001 From: aniversarioperu Date: Wed, 3 Sep 2014 17:39:53 +0300 Subject: [PATCH] I created a test file I created a new file for testing the module dataset.freeze.format.fcsv. I wrote a test for the function ``value_to_str``. --- test/test_freeze.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 test/test_freeze.py diff --git a/test/test_freeze.py b/test/test_freeze.py new file mode 100644 index 0000000..52c94c2 --- /dev/null +++ b/test/test_freeze.py @@ -0,0 +1,17 @@ +# -*- encoding: utf-8 -*- +import unittest +from dataset.freeze.format.fcsv import value_to_str + +from .sample_data import TEST_DATA + + +class FreezeTestCase(unittest.TestCase): + + def test_value_to_str1(self): + assert '2011-01-01T00:00:00' == value_to_str(TEST_DATA[0]['date']) + + def test_value_to_str2(self): + assert 'hóla' == value_to_str(u'\u0068\u00f3\u006c\u0061') + + def test_value_to_str3(self): + assert '' == value_to_str(None)