Ejemplo n.º 1
0
 def test_check_product_with_non_exist(self):
     try:
         product.check_product(None, "NonExist")
     except Fault as f:
         self.assertEqual(f.faultCode, 404, AssertMessage.SHOULD_BE_404)
     else:
         self.fail(AssertMessage.UNEXCEPT_ERROR)
Ejemplo n.º 2
0
 def test_check_product_with_no_args(self):
     bad_args = (None, [], {}, ())
     for arg in bad_args:
         try:
             product.check_product(None, arg)
         except Fault as f:
             self.assertEqual(f.faultCode, 400, AssertMessage.SHOULD_BE_400)
         else:
             self.fail(AssertMessage.NOT_VALIDATE_ARGS)
Ejemplo n.º 3
0
 def test_check_product(self):
     try:
         cat = product.check_product(None, "StarCraft")
     except Fault:
         self.fail(AssertMessage.UNEXCEPT_ERROR)
     else:
         self.assertEqual(cat['name'], "StarCraft")
Ejemplo n.º 4
0
 def test_check_product(self):
     cat = product.check_product(None, 'Nitrate')
     self.assertEqual(cat['name'], 'Nitrate')
Ejemplo n.º 5
0
 def test_check_product(self):
     cat = product.check_product(None, 'Nitrate')
     self.assertEqual(cat['name'], 'Nitrate')