Пример #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]