Browse Source

Added util test file

283
Chris Glass 11 years ago
parent
commit
4675ea5321
  1. 19
      lib/tests/test_util.py

19
lib/tests/test_util.py

@ -0,0 +1,19 @@
import unittest
from lib.util import format_satoshis
class TestUtil(unittest.TestCase):
def test_format_satoshis(self):
result = format_satoshis(1234)
expected = "0.00001234"
self.assertEqual(expected, result)
def test_format_satoshis_diff_positive(self):
result = format_satoshis(1234, is_diff=True)
expected = "+0.00001234"
self.assertEqual(expected, result)
def test_format_satoshis_diff_negative(self):
result = format_satoshis(-1234, is_diff=True)
expected = "-0.00001234"
self.assertEqual(expected, result)
Loading…
Cancel
Save