def unittest(): g = group.Group() list = GeneratorList2(g, [static.Static('A'), static.Static('B'), static.Static('C')]) try: while g.next(): print(list.getValue()) except group.GroupCompleted: pass
def unittest(): g = group.Group() r = Repeater(g, static.Static('A'), 1, 10) try: while g.next(): print(r.getValue()) except group.GroupCompleted: pass
def load_static(self): pathWork = os.getcwd() pathData = os.path.join(pathWork, os.path.join("data", "static.csv")) with open(pathData, 'rb') as file: reader = csv.reader(file) temp_static_list = list(reader) for item in temp_static_list: new_static = static.Static(item[0], int(item[1]), int(item[2]), int(item[3]), int(item[4]), item[5]) self.model.static_list.append(new_static)
def unittest(): s = static.Static('hello world') block = Block([s]) if block.getRawValue() != 'hello world': raise Exception('Block::unittest: Failed getRawValue') block.remove(s) block.insert(0,s) block.clear() block.append(s) block.getSize() block.getValue()
def unittest(): block = Block([static.Static('hello world')]) blockSize = BlockSize(block) if blockSize.getBlock() != block: raise Exception("BlockSize::unittest(): Failed getBlock") blockSize.setBlock(None) if blockSize.getBlock() != None: raise Exception("BlockSize::unittest(): Failed setBlock") blockSize.setBlock(block) size = blockSize.getRawValue() if int(size) != len('hello world'): raise Exception("BlockSize::unittest(): Failed getRawValue")