Logo Search packages:      
Sourcecode: qm version File versions

def qm::test::web::web::QMTestServer::HandleSubmitSuite (   self,
  request 
)

Handle test suite submission.

'request' -- A 'WebRequest' object.

The request object has these fields:

  'id' -- The ID of the test suite being edited.  If a suite with
  this ID exists, it is replaced (it must not be an implicit suite
  though).  Otherwise a new suite is edited.

  'test_ids' -- A comma-separated list of test IDs to include in the
  suite, relative to the suite's own ID.

  'suite_ids' -- A comma-separated list of other test suite IDs to
  include in the suite, relative to the suite's own ID.

Definition at line 2345 of file web.py.

02345                                         :
        """Handle test suite submission.

        'request' -- A 'WebRequest' object.

        The request object has these fields:

          'id' -- The ID of the test suite being edited.  If a suite with
          this ID exists, it is replaced (it must not be an implicit suite
          though).  Otherwise a new suite is edited.

          'test_ids' -- A comma-separated list of test IDs to include in the
          suite, relative to the suite's own ID.

          'suite_ids' -- A comma-separated list of other test suite IDs to
          include in the suite, relative to the suite's own ID.
        """

        database = self.__database
        # Extract fields from the request.
        suite_id = request["id"]
        test_ids = request["test_ids"]
        if string.strip(test_ids) == "":
            test_ids = []
        else:
            test_ids = string.split(test_ids, ",")
        suite_ids = request["suite_ids"]
        if string.strip(suite_ids) == "":
            suite_ids = []
        else:
            suite_ids = string.split(suite_ids, ",")
        # Construct a new suite.
        suite_class = qm.test.base.get_extension_class(
            "explicit_suite.ExplicitSuite",
            "suite",
            self.GetDatabase())
        extras = { suite_class.EXTRA_DATABASE : self.GetDatabase(),
                   suite_class.EXTRA_ID : suite_id }
        suite = suite_class({ "test_ids" : test_ids,
                              "suite_ids" : suite_ids },
                            **extras)
        # Store it.
        database.WriteExtension(suite_id, suite)
        # Redirect to a page that displays the newly-edited item.
        raise qm.web.HttpRedirect, \
              qm.web.WebRequest("show-suite", base=request, id=suite_id)


    def MakeNewTest(self, test_class_name, test_id):


Generated by  Doxygen 1.6.0   Back to index