示例#1
0
    def printSummary(self, start, stop):
        """Called by the test runner to print the final summary of test
        run results.
        """
        write = self.stream.write
        writeln = self.stream.writeln
        taken = float(stop - start)
        run = self.testsRun
        plural = run != 1 and "s" or ""

        writeln(self.separator2)
        writeln("Ran %s test%s in %.3fs" % (run, plural, taken))
        writeln()
        if not self.wasSuccessful():
            write("FAILED (")
            summary = odict()
            summary['failures'], summary['errors'] = \
                               map(len, [self.failures, self.errors])
            for cls in self.errorClasses.keys():
                storage, label, isfail = self.errorClasses[cls]
                if not isfail:
                    continue
                summary[label] = len(storage)
            any = False
            for label, count in summary.items():
                if not count:
                    continue
                if any:
                    write(", ")
                write("%s=%s" % (label, count))
                any = True
            writeln(")")
        else:
            writeln("OK")
示例#2
0
 def printSummary(self, start, stop):
     """Called by the test runner to print the final summary of test
     run results.
     """
     write = self.stream.write
     writeln = self.stream.writeln
     taken = float(stop - start)
     run = self.testsRun
     plural = run != 1 and "s" or ""
     
     writeln(self.separator2)
     writeln("Ran %s test%s in %.3fs" % (run, plural, taken))
     writeln()
     if not self.wasSuccessful():
         write("FAILED (")
         summary = odict()
         summary['failures'], summary['errors'] = \
                            map(len, [self.failures, self.errors])
         for cls in self.errorClasses.keys():
             storage, label, isfail = self.errorClasses[cls]
             if not isfail:
                 continue
             summary[label] = len(storage)
         any = False
         for label, count in summary.items():
             if not count:
                 continue
             if any:
                 write(", ")
             write("%s=%s" % (label, count))
             any = True
         writeln(")")
     else:
         writeln("OK")
示例#3
0
    def test_get_all_files(self):
        with patch('xmlrpclib.MultiCall', MultiCall) as mc:
            rdict = self.inst.get_all_files()
            tst = odict()
            for d, info in downloads.items():
                # Don't compare path
                tst[d] = info
                tst[d]['files'] = self.inst.conn.get_files(d)

            for k, v in tst.items():
                # Don't compare path key
                eitems = sorted([(j, z) for j, z in v.items() if j != 'path'])
                ritems = sorted(rdict[k].items())
                print eitems
                print ritems
                eq_(eitems, ritems)
示例#4
0
    def test_get_all_files( self ):
        with patch( 'xmlrpclib.MultiCall', MultiCall ) as mc:
            rdict = self.inst.get_all_files()
            tst = odict()
            for d, info in downloads.items():
                # Don't compare path
                tst[d] = info
                tst[d]['files'] = self.inst.conn.get_files(d)

            for k, v in tst.items():
                # Don't compare path key
                eitems = sorted([(j,z) for j,z in v.items() if j != 'path'])
                ritems = sorted(rdict[k].items())
                print eitems
                print ritems
                eq_( eitems, ritems )
示例#5
0
 def reset(self):
     self._nullPluginManager = NoPlugins()
     self.called = odict()
示例#6
0
 def reset(self):
     self._nullPluginManager = NoPlugins()
     self.called = odict()