Skip to content

Commit e5b41e4

Browse files
committedMar 17, 2019
use explicitly ListWeightedMap in tests
1 parent de6b6bc commit e5b41e4

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed
 

‎tests/test_large_case.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def large_one_to_one():
3333
wmap_list.append({'from': str(e), 'to': str(e), 'weight': 0})
3434
wmap_list.append({'from': str(e), 'to': str((e + 1) % len(elements)), 'weight': 1})
3535
wmap_list.append({'from': str(e), 'to': str((e - 1) % len(elements)), 'weight': 1})
36-
wmap = allocating.WeightedMap(wmap_list)
36+
wmap = allocating.ListWeightedMap(wmap_list)
3737

3838
yield allocating.Allocator(sources, wmap, targets)
3939

@@ -48,7 +48,7 @@ def large_one_to_one_alternate():
4848
wmap_list.append({'from': str(e), 'to': str(e), 'weight': 1})
4949
wmap_list.append({'from': str(e), 'to': str((e + 1) % len(elements)), 'weight': 3 * (e % 2)})
5050
wmap_list.append({'from': str(e), 'to': str((e - 1) % len(elements)), 'weight': 2.5})
51-
wmap = allocating.WeightedMap(wmap_list)
51+
wmap = allocating.ListWeightedMap(wmap_list)
5252

5353
yield allocating.Allocator(sources, wmap, targets)
5454

@@ -77,7 +77,7 @@ def large_random(sources_number, targets_number, choices, limit_denominator):
7777
for t in stargets:
7878
wmap_list.append({'from': source, 'to': t,
7979
'weight': random.uniform(0, 1)})
80-
wmap = allocating.WeightedMap(wmap_list)
80+
wmap = allocating.DictWeightedMap(wmap_list)
8181

8282
return allocating.Allocator(sources, wmap, targets, limit_denominator)
8383

‎tests/test_small_cases.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def small_wmap():
4545
{'from': 'a', 'to': 1, 'weight': 0},
4646
{'from': 'b', 'to': 0, 'weight': 2}
4747
]
48-
yield allocating.WeightedMap(the_list)
48+
yield allocating.ListWeightedMap(the_list)
4949

5050

5151
@pytest.fixture
@@ -157,7 +157,7 @@ def small_allocator_2():
157157
{'from': 'b', 'to': 0, 'weight': 1},
158158
{'from': 'b', 'to': 1, 'weight': 0}
159159
]
160-
wmap = allocating.WeightedMap(the_list)
160+
wmap = allocating.ListWeightedMap(the_list)
161161
instances = {'a': 2, 'b': 1}
162162
capacities = {0: 2, 1: 1}
163163
yield allocating.Allocator(instances, wmap, capacities)
@@ -174,7 +174,7 @@ def small_allocator_3():
174174
the_list = [
175175
{'from': 'a', 'to': 0, 'weight': 0},
176176
]
177-
wmap = allocating.WeightedMap(the_list)
177+
wmap = allocating.ListWeightedMap(the_list)
178178
instances = {'a': 1}
179179
capacities = {0: 1, 1: 1}
180180
yield allocating.Allocator(instances, wmap, capacities)

0 commit comments

Comments
 (0)
Please sign in to comment.