Esempio n. 1
0
 def test_get_build_with_no_args(self):
     bad_args = (None, [], {}, ())
     for arg in bad_args:
         try:
             product.get_builds(None, arg)
         except Fault as f:
             self.assertEqual(f.faultCode, 400, AssertMessage.SHOULD_BE_400)
         else:
             self.fail(AssertMessage.NOT_VALIDATE_ARGS)
Esempio n. 2
0
    def test_get_build_with_non_exist_prod(self):
        try:
            product.get_builds(None, 9999)
        except Fault as f:
            self.assertEqual(f.faultCode, 404, AssertMessage.SHOULD_BE_404)
        else:
            self.fail(AssertMessage.NOT_VALIDATE_ARGS)

        try:
            product.get_builds(None, "Unknown Product")
        except Fault as f:
            self.assertEqual(f.faultCode, 404, AssertMessage.SHOULD_BE_404)
        else:
            self.fail(AssertMessage.NOT_VALIDATE_ARGS)
Esempio n. 3
0
 def test_get_build_with_name(self):
     try:
         builds = product.get_builds(None, "StarCraft")
     except Fault:
         self.fail(AssertMessage.UNEXCEPT_ERROR)
     else:
         self.assertIsNotNone(builds)
         self.assertEqual(len(builds), 4)
Esempio n. 4
0
 def test_get_build_with_name(self):
     builds = product.get_builds(None, "StarCraft")
     self.assertIsNotNone(builds)
     self.assertEqual(len(builds), self.builds_count + 1)
     self.assertEqual('unspecified', builds[0]['name'])
Esempio n. 5
0
 def test_get_build_with_name(self):
     builds = product.get_builds(None, "StarCraft")
     self.assertIsNotNone(builds)
     self.assertEqual(len(builds), self.builds_count + 1)
     self.assertEqual('unspecified', builds[0]['name'])