aboutsummaryrefslogtreecommitdiff
path: root/wqflask
diff options
context:
space:
mode:
authorBonfaceKilz2020-07-23 02:54:59 +0300
committerBonfaceKilz2020-07-24 03:48:28 +0300
commitbcf98cc6c1f0208cc8f9a21d36196627e1d6e6b6 (patch)
treeb77ecf0cc954dea50fd460b9534acfa4e0b91abc /wqflask
parent70a8b445df32b7ed15612ffa745269959eb9159b (diff)
downloadgenenetwork2-bcf98cc6c1f0208cc8f9a21d36196627e1d6e6b6.tar.gz
Rename test_numify.py to test_formatting.py
Diffstat (limited to 'wqflask')
-rw-r--r--wqflask/tests/utility/test_numify.py33
1 files changed, 0 insertions, 33 deletions
diff --git a/wqflask/tests/utility/test_numify.py b/wqflask/tests/utility/test_numify.py
deleted file mode 100644
index 9d3033d1..00000000
--- a/wqflask/tests/utility/test_numify.py
+++ /dev/null
@@ -1,33 +0,0 @@
-import unittest
-from utility.formatting import numify, commify
-
-
-class TestFormatting(unittest.TestCase):
- """Test formatting numbers by numifying or commifying"""
-
- def test_numify(self):
- "Test that a number is correctly converted to a English readable string"
- self.assertEqual(numify(1, 'item', 'items'),
- 'one item')
- self.assertEqual(numify(2, 'book'), 'two')
- self.assertEqual(numify(2, 'book', 'books'), 'two books')
- self.assertEqual(numify(0, 'book', 'books'), 'zero books')
- self.assertEqual(numify(0), 'zero')
- self.assertEqual(numify(5), 'five')
- self.assertEqual(numify(14, 'book', 'books'), '14 books')
- self.assertEqual(numify(999, 'book', 'books'), '999 books')
- self.assertEqual(numify(1000000, 'book', 'books'), '1,000,000 books')
- self.assertEqual(numify(1956), '1956')
-
- def test_commify(self):
- "Test that commas are added correctly"
- self.assertEqual(commify(1), '1')
- self.assertEqual(commify(123), '123')
- self.assertEqual(commify(1234), '1234')
- self.assertEqual(commify(12345), '12,345')
- self.assertEqual(commify(1234567890), '1,234,567,890')
- self.assertEqual(commify(123.0), '123.0')
- self.assertEqual(commify(1234.5), '1234.5')
- self.assertEqual(commify(1234.56789), '1234.56789')
- self.assertEqual(commify(123456.789), '123,456.789')
- self.assertEqual(commify(None), None)