~diegosarmentero/ubuntuone-client/fix-links

« back to all changes in this revision

Viewing changes to contrib/testing/testcase.py

  • Committer: Diego Sarmentero
  • Date: 2012-01-10 18:09:30 UTC
  • mfrom: (1161.2.15 ubuntuone-client)
  • Revision ID: diego.sarmentero@canonical.com-20120110180930-2pgtz8k08d0tj0vi
merge

Show diffs side-by-side

added added

removed removed

Lines of Context:
275
275
        mmtree(path): support read-only shares
276
276
        makedirs(path): support read-only shares
277
277
    """
 
278
    MAX_FILENAME = 32 # some platforms limit lengths of filenames
278
279
 
279
280
    def mktemp(self, name='temp'):
280
281
        """ Customized mktemp that accepts an optional name argument. """
292
293
        # check if we already generated the root path
293
294
        if self.__root:
294
295
            return self.__root
295
 
        base = os.path.join(self.__class__.__module__,
296
 
                            self.__class__.__name__,
 
296
        base = os.path.join(self.__class__.__module__[:self.MAX_FILENAME],
 
297
                            self.__class__.__name__[:self.MAX_FILENAME],
297
298
                            self._testMethodName)
298
299
        # use _trial_temp dir, it should be TRIAL_TEMP_DIR or os.getcwd()
299
300
        # define the root temp dir of the testcase, pylint: disable=W0201