Rev | Line | |
---|
[314] | 1 | import unittest
|
---|
| 2 | from unitpy.GeneralTests import GeneralTests
|
---|
| 3 | from tudelft.utilities.immutablelist.MapList import MapList
|
---|
| 4 | from tudelft.utilities.immutablelist.FixedList import FixedList
|
---|
| 5 | from typing import List
|
---|
| 6 |
|
---|
| 7 | class 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.