コード例 #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
ファイル: test_testplan.py プロジェクト: artjoman/Nitrate
    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
ファイル: test_testplan.py プロジェクト: Aaln1986/Nitrate
    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)