<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def update(self, request):
 """Updates the wiki page with the results of the unit tests run for the pull request. :arg percent: the percent success rate of the unit tests. :arg ttotal: the total time elapsed in running *all* the unit tests. """

        from os import path
        self._site_login(request.repo)
        self.prefix = "{}_Pull_Request_{}".format(request.repo.name, request.pull.number)
                
        #Before we can update the results from stdout, we first need to upload them to the
        #server. The files can be quite big sometimes; if a file is larger than 1MB, we ...
        for i, test in enumerate(request.repo.testing.tests):
            test["remote_file"] = "{}_{}.txt".format(self.prefix, i)
            if test["result"] is not None and path.isfile(test["result"]):
                #Over here, we might consider doing something different if the wiki server
                #is the same physical machine as the CI server; we needn't use the network
                #protocols for the copy then. However, the machine knows already if an address
                #it is accessing is its own; the copy, at worst, would be through the named
                #pipes over TCP. It is wasteful compared to a HDD copy, but simplifies the
                #uploading (which must also make an entry in the wiki database).
                if not self.testmode:
                    self.site.upload(open(test["result"]), test["remote_file"],
                                     '`stdout` from `{}`'.format(test["command"]))

        #Now we can just overwrite the page with the additional test results, including the
        #links to the stdout files we uploaded.
        head = list(self._newpage_head)
        #Add a link to the details page that points back to the github pull request URL.
        head.append("==Github Pull Request Info==\n")
        head.append(request.wiki())
        head.append("==Commands Run for Unit Testing==\n")
        head.append(request.repo.testing.wiki())
        if not self.testmode:
            page = self.site.Pages[self.newpage]
            result = page.save('\n'.join(head), summary='Edited by CI bot with uploaded unit test details.',
                               minor=True, bot=True)
            return result[u'result'] == u'Success'
        else:
            return '\n'.join(head)