Ejemplo n.º 1
0
 def testPaid1(self):
     """paid tag takes bool or bit representation"""
     y7 = YipitDeals()
     deals = y7.main(["limit=5", "paid=1"])
     params = y7.params
     paid_found = "paid" in params
     self.assertEqual(True, paid_found)
Ejemplo n.º 2
0
 def testPaidTrue(self):
     """pass true for paid param"""
     y8 = YipitDeals()
     deals = y8.main(["limit=5", "paid=True"])
     params = y8.params
     paid_found = "paid" in params
     self.assertEqual(True, paid_found)
Ejemplo n.º 3
0
 def testMultipleDivisions(self):
     """docstring for testMultipleDivisions"""
     y6 = YipitDeals()
     deals = y6.main(["limit=5", "division=minneapolis,new-york", "tag=10"])
     params = y6.params
     division_found = "division" in params
     self.assertEqual(True, division_found)
Ejemplo n.º 4
0
 def testInvalidTag(self):
     """docstring for testInvalidTag"""
     y5 = YipitDeals()
     deals = y5.main(["limit=5", "division=minneapolis", "tag=10"])
     params = y5.params
     tag_found = "tag" in params
     self.assertEqual(False, tag_found)
Ejemplo n.º 5
0
 def testInvalidLimit(self):
     """docstring for testInvalidLimit"""
     y4 = YipitDeals()
     deals = y4.main(["limit=20A", "division=minneapolis"])
     params = y4.params
     limit_found = "limit" in params
     self.assertEqual(False, limit_found)
Ejemplo n.º 6
0
 def testInvalidDivision(self):
     """Passing invalid division"""
     y3 = YipitDeals()
     deals = y3.main(["division=newyork2", "tag=restaurants"])
     params = y3.params
     division_found = "division" in params
     self.assertEqual(False, division_found)
Ejemplo n.º 7
0
 def testNoParams(self):
     y1 = YipitDeals()
     deals = y1.main({})
     self.assertEqual(20, len(deals))
Ejemplo n.º 8
0
 def testLimit(self):
     """Passing limit to API call"""
     y2 = YipitDeals()
     deals = y2.main(["limit=5"])
     self.assertEqual(5, len(deals))