nficano commited on
Commit
703b387
·
1 Parent(s): cc83758

sizeof coverage

Browse files
Files changed (1) hide show
  1. tests/test_utils.py +10 -0
tests/test_utils.py CHANGED
@@ -19,3 +19,13 @@ class TestUtils(object):
19
  eq_(utils.safe_filename("abc##"), "abc")
20
  eq_(utils.safe_filename("abc:foo"), "abc -foo")
21
  eq_(utils.safe_filename("abc_foo"), "abc foo")
 
 
 
 
 
 
 
 
 
 
 
19
  eq_(utils.safe_filename("abc##"), "abc")
20
  eq_(utils.safe_filename("abc:foo"), "abc -foo")
21
  eq_(utils.safe_filename("abc_foo"), "abc foo")
22
+
23
+ def test_sizeof(self):
24
+ """Accurately converts the bytes to its humanized equivalent"""
25
+ eq_(utils.sizeof(1), '1 byte')
26
+ eq_(utils.sizeof(2), '2 bytes')
27
+ eq_(utils.sizeof(2400), '2 KB')
28
+ eq_(utils.sizeof(2400000), '2 MB')
29
+ eq_(utils.sizeof(2400000000), '2 GB')
30
+ eq_(utils.sizeof(2400000000000), '2 TB')
31
+ eq_(utils.sizeof(2400000000000000), '2 PB')