Chris Glass
11 years ago
1 changed files with 19 additions and 0 deletions
@ -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…
Reference in new issue