forked from LBRYCommunity/lbry-sdk
remove duplicate dewies test
This commit is contained in:
parent
01dbbb4c3a
commit
ae8bc59c65
1 changed files with 0 additions and 35 deletions
|
@ -1,41 +1,6 @@
|
|||
import unittest
|
||||
|
||||
from lbry.blockchain.util import ArithUint256
|
||||
from lbry.blockchain.util import coins_to_satoshis as c2s, satoshis_to_coins as s2c
|
||||
|
||||
|
||||
class TestCoinValueParsing(unittest.TestCase):
|
||||
|
||||
def test_good_output(self):
|
||||
self.assertEqual(s2c(1), "0.00000001")
|
||||
self.assertEqual(s2c(10**7), "0.1")
|
||||
self.assertEqual(s2c(2*10**8), "2.0")
|
||||
self.assertEqual(s2c(2*10**17), "2000000000.0")
|
||||
|
||||
def test_good_input(self):
|
||||
self.assertEqual(c2s("0.00000001"), 1)
|
||||
self.assertEqual(c2s("0.1"), 10**7)
|
||||
self.assertEqual(c2s("1.0"), 10**8)
|
||||
self.assertEqual(c2s("2.00000000"), 2*10**8)
|
||||
self.assertEqual(c2s("2000000000.0"), 2*10**17)
|
||||
|
||||
def test_bad_input(self):
|
||||
with self.assertRaises(ValueError):
|
||||
c2s("1")
|
||||
with self.assertRaises(ValueError):
|
||||
c2s("-1.0")
|
||||
with self.assertRaises(ValueError):
|
||||
c2s("10000000000.0")
|
||||
with self.assertRaises(ValueError):
|
||||
c2s("1.000000000")
|
||||
with self.assertRaises(ValueError):
|
||||
c2s("-0")
|
||||
with self.assertRaises(ValueError):
|
||||
c2s("1")
|
||||
with self.assertRaises(ValueError):
|
||||
c2s(".1")
|
||||
with self.assertRaises(ValueError):
|
||||
c2s("1e-7")
|
||||
|
||||
|
||||
class TestArithUint256(unittest.TestCase):
|
||||
|
|
Loading…
Reference in a new issue