~mterry/duplicity/backend-unification

« back to all changes in this revision

Viewing changes to testing/unit/test_lazy.py

  • Committer: Michael Terry
  • Date: 2014-04-20 05:58:47 UTC
  • mto: This revision was merged to the branch mainline in revision 978.
  • Revision ID: michael.terry@canonical.com-20140420055847-5btxtxythvsblgpk
More reorg of testing/

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
# along with duplicity; if not, write to the Free Software Foundation,
20
20
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21
21
 
22
 
import helper
23
22
import unittest, pickle, sys
24
23
from functools import reduce
25
24
 
26
25
from duplicity.lazy import * #@UnusedWildImport
27
 
 
28
 
helper.setup()
29
 
 
30
 
class Iterators(unittest.TestCase):
 
26
from . import UnitTestCase
 
27
 
 
28
 
 
29
class Iterators(UnitTestCase):
31
30
    one_to_100 = lambda s: iter(range(1, 101))
32
31
    evens = lambda s: iter(range(2, 101, 2))
33
32
    odds = lambda s: iter(range(1, 100, 2))
34
33
    empty = lambda s: iter([])
35
34
 
36
35
    def __init__(self, *args):
37
 
        unittest.TestCase.__init__(self, *args)
 
36
        super(Iterators, self).__init__(*args)
38
37
        self.falseerror = self.falseerror_maker()
39
38
        self.trueerror = self.trueerror_maker()
40
39
        self.emptygen = self.emptygen_maker()
275
274
        #print "Adding branch ", subinstance.total
276
275
        self.total += subinstance.total
277
276
 
278
 
class TreeReducerTest(unittest.TestCase):
 
277
class TreeReducerTest(UnitTestCase):
279
278
    def setUp(self):
 
279
        super(TreeReducerTest, self).setUp()
 
280
 
280
281
        self.i1 = [(), (1,), (2,), (3,)]
281
282
        self.i2 = [(0,), (0,1), (0,1,0), (0,1,1), (0,2), (0,2,1), (0,3)]
282
283