source: utilitiespy/test/immutablelist/MapListTest.py@ 897

Last change on this file since 897 was 314, checked in by wouter, 3 years ago

#105 added JoinedList, MapList, Tuple, release 1.0.5

File size: 732 bytes
RevLine 
[314]1import unittest
2from unitpy.GeneralTests import GeneralTests
3from tudelft.utilities.immutablelist.MapList import MapList
4from tudelft.utilities.immutablelist.FixedList import FixedList
5from typing import List
6
7class MapListTest (unittest.TestCase, GeneralTests[MapList]):
8
9 list1 = FixedList((5, 8, 2))
10 list2 = FixedList( [5, 5, 4, 3])
11
12 f = lambda v : v + 1
13 f2 = lambda v : v + 2
14
15 map1 = MapList(f, list1)
16 map1a = MapList(f, list1)
17 map2 = MapList(f2, list1)
18 map3 = MapList(f, list2)
19
20 #Override
21 def getGeneralTestData(self)->List[List[MapList]]:
22 return [[self.map1, self.map1a], [self.map2],[self.map3]]
23
24 #Override
25 def getGeneralTestStrings(self)->List[str] :
26 return ["\\[6,9,3\\]", "\\[7,10,4\\]", "\\[6,6,5,4\\]"]
Note: See TracBrowser for help on using the repository browser.