from random import random import unittest from tudelft.utilities.immutablelist.Tuple import Tuple from unitpy.GeneralTests import GeneralTests from tudelft.utilities.immutablelist.Tuples import Tuples from tudelft.utilities.immutablelist.FixedList import FixedList from tudelft.utilities.immutablelist.ImmutableList import ImmutableList from typing import List class TupleTest(unittest.TestCase, GeneralTests[Tuples]): list1:ImmutableList[str] = FixedList(["a", "b"]) list2:ImmutableList[int] = FixedList([1, 2]) list3:ImmutableList[float] = FixedList([1.2, 1.5]) tuples1:Tuples = Tuples(list1, list2) tuples1a:Tuples = Tuples(list1, list2) tuples2:Tuples = Tuples(list1, list3) tuples3:Tuples = Tuples(list2, list2) def getGeneralTestData(self) -> List[List[Tuples]]: return [[self.tuples1, self.tuples1a],[self.tuples2], [self.tuples3]] def getGeneralTestStrings(self) -> List[str]: return ["\\[\\\\,\\,\\,\\\\]", "\\[\\,\\,\\,\\\\]", "\\[\\<1,1\\>,\\<2,1\\>,\\<1,2\\>,\\<2,2\\>\\]"]