Пример #1
0
    def test_get_product(self):
        self.assertRaisesXmlrpcFault(NOT_FOUND, XmlrpcTestPlan.get_product, self.http_req, 0)

        result = XmlrpcTestPlan.get_product(self.http_req, str(self.plan.pk))
        self._verify_serialize_result(result)

        result = XmlrpcTestPlan.get_product(self.http_req, self.plan.pk)
        self._verify_serialize_result(result)

        self.assertRaisesXmlrpcFault(BAD_REQUEST, XmlrpcTestPlan.get_product,
                                     self.http_req, 'plan_id')
Пример #2
0
    def test_get_product(self):
        # self.assertXmlrpcFaultNotFound(
        #     XmlrpcTestPlan.get_product, self.http_req, 0)

        result = XmlrpcTestPlan.get_product(self.http_req, str(self.plan.pk))
        self._verify_serialize_result(result)

        result = XmlrpcTestPlan.get_product(self.http_req, self.plan.pk)
        self._verify_serialize_result(result)

        self.assertXmlrpcFaultBadRequest(XmlrpcTestPlan.get_product,
                                         self.http_req, 'plan_id')
Пример #3
0
    def test_get_product(self):
        try:
            XmlrpcTestPlan.get_product(self.http_req, 0)
            self.fail('Passing 0 should cause 404 error due to it does not ' +
                      'exist.')
        except Fault as e:
            self.assertEqual(404, e.faultCode)

        result = XmlrpcTestPlan.get_product(self.http_req, str(self.plan.pk))
        self._verify_serialize_result(result)

        result = XmlrpcTestPlan.get_product(self.http_req, self.plan.pk)
        self._verify_serialize_result(result)

        try:
            XmlrpcTestPlan.get_product(self.http_req, 'plan_id')
        except Fault as e:
            self.assertEqual(400, e.faultCode)
Пример #4
0
    def test_get_product(self):
        try:
            XmlrpcTestPlan.get_product(self.http_req, 0)
            self.fail('Passing 0 should cause 404 error due to it does not ' +
                      'exist.')
        except Fault as e:
            self.assertEqual(404, e.faultCode)

        result = XmlrpcTestPlan.get_product(self.http_req, str(self.plan.pk))
        self._verify_serialize_result(result)

        result = XmlrpcTestPlan.get_product(self.http_req, self.plan.pk)
        self._verify_serialize_result(result)

        try:
            XmlrpcTestPlan.get_product(self.http_req, 'plan_id')
        except Fault as e:
            self.assertEqual(400, e.faultCode)