示例#1
0
    def __init__(self):
        self.collection = testdata.merge_lists(
                [None], 
                testdata.list_bool,
                testdata.list_int,
                testdata.list_float,
                testdata.list_long[:-1],        # the last number is very long
                testdata.list_complex,

                testdata.list_myint,
                testdata.list_myfloat,
                testdata.list_mylong,
                testdata.list_mycomplex,
                testdata.get_Int64_Byte(),
                )

        self.collection_oldstyle            = [oldstyle(x)              for x in self.collection]
        self.collection_oldstyle_reflect    = [oldstyle_reflect(x)      for x in self.collection]
        self.collection_oldstyle_notdefined = [oldstyle_notdefined(x)   for x in self.collection]
        self.collection_newstyle            = [newstyle(x)              for x in self.collection]
        self.collection_newstyle_reflect    = [newstyle_reflect(x)      for x in self.collection]
        self.collection_newstyle_notdefined = [newstyle_notdefined(x)   for x in self.collection]

        self.collection_oldstyle_inplace    = [oldstyle_inplace(x)      for x in self.collection]
        self.collection_newstyle_inplace    = [newstyle_inplace(x)      for x in self.collection]
示例#2
0
    def __init__(self):
        self.collection = testdata.merge_lists(
                [None], 
                testdata.list_bool,
                testdata.list_int,
                testdata.list_float,
                testdata.list_long[:-1],        # the last number is very long
                testdata.list_complex,

                testdata.list_myint,
                testdata.list_myfloat,
                testdata.list_mylong,
                testdata.list_mycomplex,
                testdata.get_Int64_Byte(),
                )

        self.collection_oldstyle            = [oldstyle(x)              for x in self.collection]
        self.collection_oldstyle_reflect    = [oldstyle_reflect(x)      for x in self.collection]
        self.collection_oldstyle_notdefined = [oldstyle_notdefined(x)   for x in self.collection]
        self.collection_newstyle            = [newstyle(x)              for x in self.collection]
        self.collection_newstyle_reflect    = [newstyle_reflect(x)      for x in self.collection]
        self.collection_newstyle_notdefined = [newstyle_notdefined(x)   for x in self.collection]

        self.collection_oldstyle_inplace    = [oldstyle_inplace(x)      for x in self.collection]
        self.collection_newstyle_inplace    = [newstyle_inplace(x)      for x in self.collection]
示例#3
0
 def __init__(self):     
     self.data = testdata.merge_lists(
         [None],
         testdata.list_set, 
         testdata.list_frozenset,
         )
示例#4
0
 def __init__(self):
     self.data = testdata.merge_lists(testdata.list_dict)
示例#5
0
 def __init__(self):
     self.data = testdata.merge_lists(testdata.list_complex, testdata.list_mycomplex)
示例#6
0
 def __init__(self):
     self.data = testdata.merge_lists(testdata.list_str, testdata.list_mystr)
示例#7
0
 def __init__(self):
     self.collection = testdata.merge_lists(testdata.get_enums(), testdata.list_bool, testdata.list_int)
     self.collection_oldstyle = [oldstyle(x) for x in self.collection]
     self.collection_newstyle = [newstyle(x) for x in self.collection]
示例#8
0
class newstyle(object):         
    def __init__(self, value):
        self.value = value
    def __cmp__(self, other):
        return cmp(self.value, other)
    def __repr__(self):
        return "newstyle(%s)" % str(self.value)

import sys
                        
collection = testdata.merge_lists(
                                [None], 
                                testdata.list_int,
                                testdata.list_float,
                                testdata.list_long,
                                testdata.list_bool,
                                testdata.list_myint,
                                testdata.list_myfloat,
                                testdata.list_mylong,
                            )
                            
collection_oldstyle = [oldstyle(x) for x in collection]
collection_newstyle = [newstyle(x) for x in collection]


class common(object):
    def true_compare(self, leftc, rightc, oplist = ["<", ">", ">=", "<=", "==", "<>" ]):
        for a in leftc:
            for b in rightc:
                if '<' in oplist:  
                    try:
示例#9
0
from __future__ import division

# not all are testing true division

import sys
from common import *
import testdata

collection = testdata.merge_lists(
                    [None],
                    testdata.list_int,
                    testdata.list_float,
                    testdata.list_bool,
                    testdata.list_long,
                    testdata.list_complex,
                    
                    testdata.list_myint,
                    testdata.list_myfloat,
                    testdata.list_mylong,
                    testdata.list_mycomplex,
                )

class oldstyle:
    def __init__(self, value):
        self.value = value
    def __truediv__(self, other):
        return self.value / other
    def __rtruediv__(self, other):
        return other / self.value        
    def __itruediv__(self, other):
示例#10
0
 def __init__(self):     
     self.data = testdata.merge_lists(
         [None],
         testdata.list_set, 
         testdata.list_frozenset,
         )
示例#11
0
 def __init__(self):
     self.data = testdata.merge_lists(testdata.list_dict)
示例#12
0
 def __init__(self):
     self.data = testdata.merge_lists(testdata.list_complex, testdata.list_mycomplex)
示例#13
0
 def __init__(self):
     self.data = testdata.merge_lists(testdata.list_str, testdata.list_mystr)
示例#14
0
 def __init__(self):
     self.collection = testdata.merge_lists(testdata.get_enums(), testdata.list_bool, testdata.list_int)
     self.collection_oldstyle = [oldstyle(x) for x in self.collection]
     self.collection_newstyle = [newstyle(x) for x in self.collection]