Example #1
0
    def consumePath(self, path):
        while path and path[0] == "-":
            path = path[1:]

        if path and path[0] == "individualTest":
            return self.contextFor(ComboContexts.IndividualTest(self.testRun, "/".join(path[1:]))), []

        return None, path
Example #2
0
    def consumePath(self, path):
        while path and path[0] == "-":
            path = path[1:]

        if path and path[0] == "individualTest":
            return self.contextFor(ComboContexts.IndividualTest(self.test, "/".join(path[1:]))), []

        if path and path[0] == "test":
            items, remainder = self.popToDash(path[1:])

            return self.renderer.contextFor(ComboContexts.IndividualTest(self.test, "/".join(items)), self.options), remainder

        if path:
            testRun = self.database.TestRun(path[0])
            if testRun.exists():
                return self.renderer.contextFor(testRun, self.options), path[1:]

        return None, path
Example #3
0
    def consumePath(self, path):
        while path and path[0] == "-":
            path = path[1:]

        if path and path[0] == "individualTest":
            return self.contextFor(
                ComboContexts.IndividualTest(self.primaryObject(),
                                             "/".join(path[1:]))), []

        if path and path[0] == "configurations":
            groupPath, remainder = self.popToDash(path[1:])

            if not path:
                return None, path

            configurationName = "/".join(groupPath)

            return self.contextFor(
                ComboContexts.CommitAndFilter(self.commit, configurationName,
                                              self.projectFilter)), remainder

        if path and path[0] == "projects":
            groupPath, remainder = self.popToDash(path[1:])

            if not path:
                return None, path

            projectName = "/".join(groupPath)

            return self.contextFor(
                ComboContexts.CommitAndFilter(self.commit, self.configFilter,
                                              projectName)), remainder

        if path and path[0] == "tests":
            testpath, remainder = self.popToDash(path[1:])

            testname = "/".join(testpath)

            if testname in self.commit.data.tests:
                test = self.commit.data.tests[testname]
            else:
                return None, path

            return self.renderer.contextFor(test, self.options), remainder

        return None, path
 def primaryObject(self):
     return ComboContexts.IndividualTest(
         context=self.context, individualTestName=self.individualTestName)