@@ -88,9 +88,7 @@ def test_convert_to_btc_on_with_valid_currency(self):
8888
8989 def test_convert_to_btc_on_with_invalid_currency (self ):
9090 date_obj = datetime .datetime .today () - datetime .timedelta (days = 15 )
91- # coins = convert_to_btc_on(300, 'XYZ', date_obj)
9291 self .assertRaises (RatesNotAvailableError , convert_to_btc_on , 300 , 'XYZ' , date_obj )
93- # self.assertFalse(coins)
9492
9593
9694class TestConvertBtcToCurOn (TestCase ):
@@ -104,9 +102,7 @@ def test_convert_to_btc_on_with_valid_currency(self):
104102
105103 def test_convert_to_btc_on_with_invalid_currency (self ):
106104 date_obj = datetime .datetime .today () - datetime .timedelta (days = 15 )
107- # amount = convert_btc_to_cur_on(3, 'XYZ', date_obj)
108105 self .assertRaises (RatesNotAvailableError , convert_btc_to_cur_on , 3 , 'XYZ' , date_obj )
109- # self.assertFalse(amount)
110106
111107
112108class TestBitCoinSymbol (TestCase ):
@@ -137,9 +133,7 @@ def test_previous_price_valid_currency(self):
137133
138134 def test_previous_price_invalid_currency (self ):
139135 date_obj = datetime .datetime .today () - datetime .timedelta (days = 15 )
140- # price = self.b.get_previous_price('XYZ', date_obj)
141136 self .assertRaises (RatesNotAvailableError , self .b .get_previous_price , 'XYZ' , date_obj )
142- # self.assertFalse(price)
143137
144138 def test_previous_price_list_with_valid_currency (self ):
145139 start_date = datetime .datetime .today () - datetime .timedelta (days = 15 )
@@ -160,9 +154,7 @@ def test_convet_to_btc_with_valid_currency(self):
160154 self .assertEqual (type (coins ), float )
161155
162156 def test_convet_to_btc_with_invalid_currency (self ):
163- # coins = self.b.convert_to_btc(250, 'XYZ')
164157 self .assertRaises (RatesNotAvailableError , self .b .convert_to_btc , 250 , 'XYZ' )
165- # self.assertFalse(coins)
166158
167159 def test_convert_btc_to_cur_valid_currency (self ):
168160 amount = self .b .convert_btc_to_cur (2 , 'USD' )
@@ -178,9 +170,7 @@ def test_convert_to_btc_on_with_valid_currency(self):
178170
179171 def test_convert_to_btc_on_with_invalid_currency (self ):
180172 date_obj = datetime .datetime .today () - datetime .timedelta (days = 15 )
181- # coins = self.b.convert_to_btc_on(300, 'XYZ', date_obj)
182173 self .assertRaises (RatesNotAvailableError , self .b .convert_to_btc_on , 300 , 'XYZ' , date_obj )
183- # self.assertFalse(coins)
184174
185175 def test_convert_to_btc_on_with_valid_currency (self ):
186176 date_obj = datetime .datetime .today () - datetime .timedelta (days = 15 )
@@ -189,9 +179,7 @@ def test_convert_to_btc_on_with_valid_currency(self):
189179
190180 def test_convert_to_btc_on_with_invalid_currency (self ):
191181 date_obj = datetime .datetime .today () - datetime .timedelta (days = 15 )
192- # amount = self.b.convert_btc_to_cur_on(3, 'XYZ', date_obj)
193182 self .assertRaises (RatesNotAvailableError , self .b .convert_btc_to_cur_on , 3 , 'XYZ' , date_obj )
194- # self.assertFalse(amount)
195183
196184
197185class TestBitCoinForceDecimal (TestCase ):
@@ -214,9 +202,7 @@ def test_previous_price_valid_currency(self):
214202
215203 def test_previous_price_invalid_currency (self ):
216204 date_obj = datetime .datetime .today () - datetime .timedelta (days = 15 )
217- # price = self.b.get_previous_price('XYZ', date_obj)
218205 self .assertRaises (RatesNotAvailableError , self .b .get_previous_price , 'XYZ' , date_obj )
219- # self.assertFalse(price)
220206
221207 def test_previous_price_list_with_valid_currency (self ):
222208 start_date = datetime .datetime .today () - datetime .timedelta (days = 15 )
@@ -233,39 +219,34 @@ def test_previous_price_list_with_invalid_currency(self):
233219 self .assertEqual (type (price_list ), dict )
234220
235221 def test_convet_to_btc_with_valid_currency (self ):
236- coins = self .b .convert_to_btc (250 , 'USD' )
222+ coins = self .b .convert_to_btc (Decimal ( ' 250' ) , 'USD' )
237223 self .assertEqual (type (coins ), Decimal )
238224
239225 def test_convet_to_btc_with_invalid_currency (self ):
240- # coins = self.b.convert_to_btc(250, 'XYZ')
241226 self .assertRaises (RatesNotAvailableError , self .b .convert_to_btc , Decimal ('250' ), 'XYZ' )
242- # self.assertFalse(coins)
243227
244228 def test_convert_btc_to_cur_valid_currency (self ):
245- amount = self .b .convert_btc_to_cur (2 , 'USD' )
229+ amount = self .b .convert_btc_to_cur (Decimal ( '2' ) , 'USD' )
246230 self .assertEqual (type (amount ), Decimal )
247231
248232 def test_convert_btc_to_cur_invalid_currency (self ):
249- self .assertRaises (RatesNotAvailableError , self .b .convert_btc_to_cur , 2 , 'XYZ' )
233+ self .assertRaises (RatesNotAvailableError , self .b .convert_btc_to_cur , Decimal ( '250' ) , 'XYZ' )
250234
251235 def test_convert_to_btc_on_with_valid_currency (self ):
252236 date_obj = datetime .datetime .today () - datetime .timedelta (days = 15 )
253- coins = self .b .convert_to_btc_on (300 , 'USD' , date_obj )
237+ coins = self .b .convert_to_btc_on (Decimal ( ' 300' ) , 'USD' , date_obj )
254238 self .assertEqual (type (coins ), Decimal )
255239
256240 def test_convert_to_btc_on_with_invalid_currency (self ):
257241 date_obj = datetime .datetime .today () - datetime .timedelta (days = 15 )
258- # coins = self.b.convert_to_btc_on(300, 'XYZ', date_obj)
259242 self .assertRaises (RatesNotAvailableError , self .b .convert_to_btc_on , Decimal ('250' ), 'XYZ' , date_obj )
260- # self.assertFalse(coins)
261243
262244 def test_convert_to_btc_on_with_valid_currency (self ):
263245 date_obj = datetime .datetime .today () - datetime .timedelta (days = 15 )
264- amount = self .b .convert_btc_to_cur_on (3 , 'USD' , date_obj )
246+ amount = self .b .convert_btc_to_cur_on (Decimal ( '250' ) , 'USD' , date_obj )
265247 self .assertEqual (type (amount ), Decimal )
266248
267249 def test_convert_to_btc_on_with_invalid_currency (self ):
268250 date_obj = datetime .datetime .today () - datetime .timedelta (days = 15 )
269- # amount = self.b.convert_btc_to_cur_on(3, 'XYZ', date_obj)
270251 self .assertRaises (RatesNotAvailableError , self .b .convert_btc_to_cur_on , Decimal ('3' ), 'XYZ' , date_obj )
271- # self.assertFalse(amount)
252+
0 commit comments