Exemplo n.º 1
0
 def test_build_get_with_non_exist_id(self):
     try:
         build.get_caseruns(None, 9999)
     except Fault as f:
         self.assertEqual(f.faultCode, 404, AssertMessage.SHOULD_BE_404)
     else:
         self.fail(AssertMessage.NOT_VALIDATE_ARGS)
Exemplo n.º 2
0
 def test_build_get_with_non_exist_id(self):
     try:
         build.get_caseruns(None, 9999)
     except Fault as f:
         self.assertEqual(f.faultCode, 404, AssertMessage.SHOULD_BE_404)
     else:
         self.fail(AssertMessage.NOT_VALIDATE_ARGS)
Exemplo n.º 3
0
 def test_build_get_with_non_integer(self):
     bad_args = (True, False, (1,), dict(a=1), -1, 0.7, "", "AA")
     for arg in bad_args:
         try:
             build.get_caseruns(None, arg)
         except Fault as f:
             self.assertEqual(f.faultCode, 400, AssertMessage.SHOULD_BE_400)
         else:
             self.fail(AssertMessage.NOT_VALIDATE_ARGS)
Exemplo n.º 4
0
 def test_build_get_with_no_args(self):
     bad_args = (None, [], (), {})
     for arg in bad_args:
         try:
             build.get_caseruns(None, arg)
         except Fault as f:
             self.assertEqual(f.faultCode, 400, AssertMessage.SHOULD_BE_400)
         else:
             self.fail(AssertMessage.NOT_VALIDATE_ARGS)
Exemplo n.º 5
0
 def test_build_get_with_non_integer(self):
     bad_args = (True, False, (1,), dict(a=1), -1, 0.7, "", "AA")
     for arg in bad_args:
         try:
             build.get_caseruns(None, arg)
         except Fault as f:
             self.assertEqual(f.faultCode, 400, AssertMessage.SHOULD_BE_400)
         else:
             self.fail(AssertMessage.NOT_VALIDATE_ARGS)
Exemplo n.º 6
0
 def test_build_get_with_no_args(self):
     bad_args = (None, [], (), {})
     for arg in bad_args:
         try:
             build.get_caseruns(None, arg)
         except Fault as f:
             self.assertEqual(f.faultCode, 400, AssertMessage.SHOULD_BE_400)
         else:
             self.fail(AssertMessage.NOT_VALIDATE_ARGS)
Exemplo n.º 7
0
 def test_build_get_with_id(self):
     try:
         b = build.get_caseruns(None, 5)
     except Fault as f:
         print f.faultString
         self.fail(AssertMessage.UNEXCEPT_ERROR)
     else:
         self.assertIsNotNone(b)
         self.assertEqual(len(b), 5)
         self.assertEqual(b[0]['case'], "PVZ")
Exemplo n.º 8
0
 def test_build_get_with_id(self):
     try:
         b = build.get_caseruns(None, 5)
     except Fault as f:
         print f.faultString
         self.fail(AssertMessage.UNEXCEPT_ERROR)
     else:
         self.assertIsNotNone(b)
         self.assertEqual(len(b), 5)
         self.assertEqual(b[0]["case"], "PVZ")
Exemplo n.º 9
0
 def test_build_get_with_id(self):
     b = build.get_caseruns(None, self.build.pk)
     self.assertIsNotNone(b)
     self.assertEqual(2, len(b))
     self.assertEqual(b[0]['case'], encode(self.case_run_1.case.summary))
Exemplo n.º 10
0
 def test_build_get_with_id(self):
     b = build.get_caseruns(None, self.build.pk)
     self.assertIsNotNone(b)
     self.assertEqual(2, len(b))
     self.assertEqual(b[0]['case'], encode_if_py3(self.case_run_1.case.summary))