Changeset 101

Show
Ignore:
Timestamp:
11/19/07 15:11:56 (1 year ago)
Author:
edsuom
Message:

Moved pack module to public Twisted-Goodies package

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • projects/Twisted-Goodies/trunk/twisted_goodies/pybywire/params.py

    r100 r101  
    44# graciously granted by Twisted Matrix Laboratories, http://twistedmatrix.com. 
    55# 
    6 # Copyright (C) 2006-2007 by Edwin A. Suominen, http://www.eepatents.com 
     6# Copyright (C) 2007 by Edwin A. Suominen, http://www.eepatents.com 
    77# 
    88# This program is free software; you can redistribute it and/or modify it under 
     
    101101        """ 
    102102        Returns a key that is based on the hashes of my key attributes and any 
    103         arguments supplied. With some recursion as needed, hashes are done even 
    104         in cases where they couldn't be ordinarily. 
     103        arguments supplied. The arguments must be hashable directly, but the 
     104        key attributes are hashed with some recursion as needed and can be 
     105        lists or dicts. 
    105106        """ 
    106107        def superHash(x): 
  • projects/Twisted-Goodies/trunk/twisted_goodies/pybywire/test/test_params.py

    r100 r101  
    44# graciously granted by Twisted Matrix Laboratories, http://twistedmatrix.com. 
    55# 
    6 # Copyright (C) 2006-2007 by Edwin A. Suominen, http://www.eepatents.com 
     6# Copyright (C) 2007 by Edwin A. Suominen, http://www.eepatents.com 
    77# 
    88# This program is free software; you can redistribute it and/or modify it under 
  • projects/Twisted-Goodies/trunk/twisted_goodies/test/mock.py

    r63 r101  
    158158        self.failUnlessEqual(*args) 
    159159 
     160    def failUnlessArraysAlmostEqual(self, X, Y, places=15): 
     161        import scipy as s 
     162        self.failUnlessEqual( 
     163            s.shape(X), s.shape(Y), "Array shapes aren't even equal!") 
     164        error = sum((X - Y)**2) 
     165        while s.shape(error): 
     166            error = sum(error) 
     167        self.failUnlessAlmostEqual(error, 0.0, places) 
     168 
    160169    @defer.deferredGenerator 
    161170    def caserator(self, method, expectations, cases, comparator=None):