ruffyen

testing

May 8th, 2013
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.68 KB | None | 0 0
  1. import unittest                                                                                                                                            
  2. import Amazon as amzn                                                                                                                                      
  3.                                                                                                                                                            
  4. class TestSequenceFunctions(unittest.TestCase):                                                                                                            
  5.     def setUp(self):                                                                                                                                      
  6.         item = amzn.parse('B005PQRLYC')                                                                                                                    
  7.                                                                                                                                                            
  8.     def test_parse_single_item_title(self):                                                                                                                
  9.         self.assertEqual(item['Title'], 'Waxed Lacing Cord, 500 Yard Spool, Black')                                                                        
  10.                                                                                                                                                            
  11.     def test_parse_single_item_price(self):                                                                                                                
  12.         self.assertTrue(Decimal(), type(Decimal(item['price'])))                                                                                          
  13.                                                                                                                                                            
  14.     def test_parse_single_item_price_2(self):                                                                                                              
  15.         self.assertIs(type(Decimal(item['price']), Decimal()))                                                                                            
  16.                                                                                                                                                            
  17. if __name__ == '__main___':                                                                                                                                
  18.     unittest.main()
Advertisement
Add Comment
Please, Sign In to add comment