-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtableau_scorer_test.py
352 lines (318 loc) · 19 KB
/
tableau_scorer_test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
#!/usr/bin/python
import unittest
import tableau_scorer
class TestTableauScorer(unittest.TestCase):
def testFreeTradeAssociation(self):
t = tableau_scorer.TableauScorer(['Free Trade Association',
'Gem World',
'Consumer Markets',
'Rebel Sympathizers',
'Expanding Colony'])
self.assertEquals(13, t.TotalPoints())
self.assertEquals(7, t.BonusPer6Dev('Free Trade Association'))
self.assertEquals(7, t.PointsPerCard('Free Trade Association'))
self.assertEquals(5, t.PointsPerCard('Consumer Markets'))
self.assertEquals(3, t.PointsPerCard('Gem World'))
self.assertEquals(2, t.PointsPerCard('Rebel Sympathizers'))
self.assertEquals(3, t.PointsPerCard('Expanding Colony'))
def testAlienTechInstitute(self):
t = tableau_scorer.TableauScorer(['Damaged Alien Factory',
'Alien Tech Institute',
'Alien Rosetta Stone World',
'Alien Robot Scout Ship',
'Expanding Colony'])
self.assertEquals(17, t.TotalPoints())
self.assertEquals(9, t.BonusPer6Dev('Alien Tech Institute'))
self.assertEquals(9, t.PointsPerCard('Alien Tech Institute'))
self.assertEquals(5, t.PointsPerCard('Damaged Alien Factory'))
self.assertEquals(9, t.Hypothetical6DevScore('Alien Tech Institute'))
self.assertEquals(2, t.Hypothetical6DevScore('Galactic Imperium'))
self.assertEquals(5, t.Hypothetical6DevScore('Galactic Survey SETI'))
def testScoreGalacticBankers(self):
t = tableau_scorer.TableauScorer(['Galactic Bankers',
'Investment Credits',
'Interstellar Bank',
'Mercenary Fleet',
'Gambling World',
'Pilgrimage World'])
self.assertEquals(14, t.TotalPoints())
self.assertEquals(8, t.BonusPer6Dev('Galactic Bankers'))
self.assertEquals(3, t.PointsPerCard('Investment Credits'))
self.assertEquals(3, t.PointsPerCard('Interstellar Bank'))
self.assertEquals(2, t.PointsPerCard('Mercenary Fleet'))
self.assertEquals(3, t.PointsPerCard('Gambling World'))
self.assertEquals(2, t.PointsPerCard('Pilgrimage World'))
def testGalacticExchange(self):
t = tableau_scorer.TableauScorer(['Galactic Exchange',
'Diversified Economy',
'Plague World',
'Smuggling World'])
self.assertEquals(6, t.BonusPer6Dev('Galactic Exchange'))
self.assertEquals(6, t.PointsPerCard('Galactic Exchange'))
self.assertEquals(5, t.PointsPerCard('Diversified Economy'))
self.assertEquals(0, t.PointsPerCard('Plague World'))
self.assertEquals(0, t.PointsPerCard('Smuggling World'))
def testGalacticExchange2(self):
t = tableau_scorer.TableauScorer(['Galactic Exchange'])
self.assertEquals(0, t.BonusPer6Dev('Galactic Exchange'))
def testGalacticExchange3(self):
t = tableau_scorer.TableauScorer(['Galactic Exchange',
'Gem World',
'Mining World',
'Comet Zone',
'Lost Species Ark World',
'Alien Toy Shop'])
self.assertEquals(10, t.BonusPer6Dev('Galactic Exchange'))
self.assertEquals(1, t.PointsPerCard('Gem World'))
self.assertEquals(2, t.PointsPerCard('Mining World'))
self.assertEquals(2, t.PointsPerCard('Comet Zone'))
self.assertEquals(3, t.PointsPerCard('Lost Species Ark World'))
self.assertEquals(1, t.PointsPerCard('Alien Toy Shop'))
def testGalacticFederation(self):
t = tableau_scorer.TableauScorer(['Galactic Federation',
'Investment Credits',
'Free Trade Association',
'Refugee World'])
self.assertEquals(5, t.BonusPer6Dev('Galactic Federation'))
self.assertEquals(5, t.PointsPerCard('Galactic Federation'))
self.assertEquals(1, t.BonusPer6Dev('Free Trade Association'))
self.assertEquals(3, t.PointsPerCard('Free Trade Association'))
def testGalacticGenomeProject(self):
t = tableau_scorer.TableauScorer(['Galactic Genome Project',
'Genetics Lab',
'Lost Species Ark World',
'Avian Uplift Race',
'Clandestine Uplift Lab'])
self.assertEquals(7, t.BonusPer6Dev('Galactic Genome Project'))
self.assertEquals(7, t.PointsPerCard('Galactic Genome Project'))
self.assertEquals(5, t.PointsPerCard('Lost Species Ark World'))
self.assertEquals(4, t.PointsPerCard('Avian Uplift Race'))
self.assertEquals(2, t.PointsPerCard('Clandestine Uplift Lab'))
def testGalacticImperium(self):
t = tableau_scorer.TableauScorer(['Galactic Imperium',
'Rebel Homeworld',
'Rebel Warrior Race',
'Former Penal Colony',
'Rebel Pact'])
self.assertEquals(5, t.BonusPer6Dev('Galactic Imperium'))
self.assertEquals(5, t.PointsPerCard('Galactic Imperium'))
self.assertEquals(9, t.PointsPerCard('Rebel Homeworld'))
self.assertEquals(4, t.PointsPerCard('Rebel Warrior Race'))
self.assertEquals(2, t.PointsPerCard('Former Penal Colony'))
self.assertEquals(1, t.PointsPerCard('Rebel Pact'))
def testGalacticRenaissance(self):
t = tableau_scorer.TableauScorer(['Galactic Renaissance',
'Galactic Trendsetters',
'Research Labs',
'Artist Colony',
'Secluded World'], 4)
self.assertEquals(21, t.TotalPoints())
self.assertEquals(10, t.BonusPer6Dev('Galactic Renaissance'))
self.assertEquals(10, t.PointsPerCard('Galactic Renaissance'))
self.assertEquals(6, t.PointsPerCard('Galactic Trendsetters'))
self.assertEquals(5, t.PointsPerCard('Research Labs'))
self.assertEquals(4, t.PointsPerCard('Artist Colony'))
def testGalacticSurveySETI(self):
t = tableau_scorer.TableauScorer(['Galactic Survey SETI',
'Research Labs',
'Star Nomad Lair',
'Investment Credits',
'Expanding Colony'])
self.assertEquals(5, t.BonusPer6Dev('Galactic Survey SETI'))
self.assertEquals(5, t.PointsPerCard('Galactic Survey SETI'))
self.assertEquals(3, t.PointsPerCard('Research Labs'))
self.assertEquals(3, t.PointsPerCard('Star Nomad Lair'))
self.assertEquals(1, t.PointsPerCard('Investment Credits'))
self.assertEquals(2, t.PointsPerCard('Expanding Colony'))
def testImperiumLords(self):
t = tableau_scorer.TableauScorer(['Imperium Lords',
'Galactic Imperium',
'Rebel Homeworld',
'Former Penal Colony'])
self.assertEquals(6, t.BonusPer6Dev('Imperium Lords'))
self.assertEquals(6, t.PointsPerCard('Imperium Lords'))
self.assertEquals(3, t.BonusPer6Dev('Galactic Imperium'))
self.assertEquals(5, t.PointsPerCard('Galactic Imperium'))
self.assertEquals(10, t.PointsPerCard('Rebel Homeworld'))
self.assertEquals(3, t.PointsPerCard('Former Penal Colony'))
def testImperiumSeat(self):
t = tableau_scorer.TableauScorer(['Imperium Seat',
'Imperium Lords',
'Rebel Underground',
'Imperium Troops',
'Insect Uplift Race',
'Rebel Pact'])
self.assertEquals(8, t.BonusPer6Dev('Imperium Seat'))
self.assertEquals(8, t.BonusPer6Dev('Imperium Lords'))
self.assertEquals(10, t.PointsPerCard('Imperium Seat'))
self.assertEquals(10, t.PointsPerCard('Imperium Lords'))
self.assertEquals(7, t.PointsPerCard('Rebel Underground'))
self.assertEquals(5, t.PointsPerCard('Imperium Troops'))
self.assertEquals(3, t.PointsPerCard('Insect Uplift Race'))
self.assertEquals(1, t.PointsPerCard('Rebel Pact'))
def testMerchantGuild(self):
t = tableau_scorer.TableauScorer(['Merchant Guild',
'Plague World',
'Destroyed World'])
self.assertEquals(2, t.BonusPer6Dev('Merchant Guild'))
self.assertEquals(2, t.PointsPerCard('Merchant Guild'))
self.assertEquals(2, t.PointsPerCard('Plague World'))
self.assertEquals(0, t.PointsPerCard('Destroyed World'))
def testMiningLeague(self):
t = tableau_scorer.TableauScorer(['Mining League',
'Mining World',
'Comet Zone',
'Smuggling Lair',
'Mining Conglomerate',
'Mining Robots',
'Secluded World'])
self.assertEquals(9, t.BonusPer6Dev('Mining League'))
self.assertEquals(9, t.PointsPerCard('Mining League'))
self.assertEquals(4, t.PointsPerCard('Comet Zone'))
self.assertEquals(4, t.PointsPerCard('Mining World'))
self.assertEquals(2, t.PointsPerCard('Smuggling Lair'))
self.assertEquals(4, t.PointsPerCard('Mining Conglomerate'))
self.assertEquals(3, t.PointsPerCard('Mining Robots'))
self.assertEquals(1, t.PointsPerCard('Secluded World'))
def testNewEconomy(self):
t = tableau_scorer.TableauScorer(['New Economy',
'Public Works',
'Export Duties',
'Secluded World',
'Destroyed World'])
self.assertEquals(5, t.BonusPer6Dev('New Economy'))
self.assertEquals(5, t.PointsPerCard('New Economy'))
self.assertEquals(3, t.PointsPerCard('Public Works'))
self.assertEquals(1, t.PointsPerCard('Export Duties'))
self.assertEquals(2, t.PointsPerCard('Secluded World'))
self.assertEquals(0, t.PointsPerCard('Destroyed World'))
def testNewGalacticOrder(self):
t = tableau_scorer.TableauScorer(['New Galactic Order',
'Lost Alien Battle Fleet',
'Contact Specialist',
'New Sparta',
'Secluded World',
'Space Mercenaries',
'Hidden Fortress'])
self.assertEquals(20, t.TotalPoints())
self.assertEquals(10, t.BonusPer6Dev('New Galactic Order'))
self.assertEquals(10, t.PointsPerCard('New Galactic Order'))
self.assertEquals(7, t.PointsPerCard('Lost Alien Battle Fleet'))
self.assertEquals(0, t.PointsPerCard('Contact Specialist'))
self.assertEquals(3, t.PointsPerCard('New Sparta'))
self.assertEquals(1, t.PointsPerCard('Secluded World'))
self.assertEquals(1, t.PointsPerCard('Space Mercenaries'))
self.assertEquals(3, t.PointsPerCard('Hidden Fortress'))
def testNewGalacticOrder2(self):
t = tableau_scorer.TableauScorer(['New Galactic Order',
'Lost Alien Battle Fleet'])
self.assertEquals(5, t.BonusPer6Dev('New Galactic Order'))
self.assertEquals(5, t.PointsPerCard('New Galactic Order'))
self.assertEquals(7, t.PointsPerCard('Lost Alien Battle Fleet'))
def testPangalacticLeague(self):
t = tableau_scorer.TableauScorer(['Pan Galactic League',
'Contact Specialist',
'Empath World',
'Rebel Miners',
'Secluded World'])
self.assertEquals(6, t.BonusPer6Dev('Pan Galactic League'))
self.assertEquals(6, t.PointsPerCard('Pan Galactic League'))
self.assertEquals(4, t.PointsPerCard('Contact Specialist'))
self.assertEquals(3, t.PointsPerCard('Empath World'))
self.assertEquals(2, t.PointsPerCard('Rebel Miners'))
self.assertEquals(1, t.PointsPerCard('Secluded World'))
def testScorePangalacticResearch(self):
t = tableau_scorer.TableauScorer(['Pan-Galactic Research',
'Export Duties'])
self.assertEquals(5, t.TotalPoints())
self.assertEquals(0, t.BonusPer6Dev('Pan-Galactic Research'))
self.assertEquals(4, t.PointsPerCard('Pan-Galactic Research'))
self.assertEquals(1, t.PointsPerCard('Export Duties'))
def testScoreProspectingGuild(self):
t = tableau_scorer.TableauScorer(['Prospecting Guild',
'Terraforming Robots',
'Asteroid Belt',
'Expanding Colony',
'Mining World'])
self.assertEquals(6, t.BonusPer6Dev('Prospecting Guild'))
self.assertEquals(6, t.PointsPerCard('Prospecting Guild'))
self.assertEquals(3, t.PointsPerCard('Terraforming Robots'))
self.assertEquals(3, t.PointsPerCard('Asteroid Belt'))
self.assertEquals(2, t.PointsPerCard('Expanding Colony'))
self.assertEquals(4, t.PointsPerCard('Mining World'))
def testScoreRebelAlliance(self):
t = tableau_scorer.TableauScorer(['Rebel Alliance',
'Rebel Miners',
'Rebel Pact',
'Lost Alien Battle Fleet'])
self.assertEquals(7, t.BonusPer6Dev('Rebel Alliance'))
self.assertEquals(7, t.PointsPerCard('Rebel Alliance'))
self.assertEquals(3, t.PointsPerCard('Rebel Miners'))
self.assertEquals(3, t.PointsPerCard('Rebel Pact'))
self.assertEquals(5, t.PointsPerCard('Lost Alien Battle Fleet'))
def testTerraformingGuild(self):
t = tableau_scorer.TableauScorer(['Terraforming Guild',
'Terraforming Robots',
'Empath World',
'Secluded World',
'Improved Logistics'])
self.assertEquals(6, t.BonusPer6Dev('Terraforming Guild'))
self.assertEquals(6, t.PointsPerCard('Terraforming Guild'))
self.assertEquals(4, t.PointsPerCard('Terraforming Robots'))
self.assertEquals(3, t.PointsPerCard('Empath World'))
self.assertEquals(1, t.PointsPerCard('Secluded World'))
self.assertEquals(2, t.PointsPerCard('Improved Logistics'))
def testTradeLeague(self):
t = tableau_scorer.TableauScorer(['Trade League',
'Export Duties',
'Merchant World',
'Deficit Spending'])
self.assertEquals(5, t.BonusPer6Dev('Trade League'))
self.assertEquals(5, t.PointsPerCard('Trade League'))
self.assertEquals(3, t.PointsPerCard('Export Duties'))
self.assertEquals(3, t.PointsPerCard('Merchant World'))
self.assertEquals(1, t.PointsPerCard('Deficit Spending'))
def testScoreUpliftCode(self):
t = tableau_scorer.TableauScorer(['Uplift Code',
'Reptilian Uplift Race',
'Abandoned Alien Uplift Camp',
'New Vinland',
'Devolved Uplift Race'])
self.assertEquals(10, t.BonusPer6Dev('Uplift Code'))
self.assertEquals(10, t.PointsPerCard('Uplift Code'))
self.assertEquals(5, t.PointsPerCard('Reptilian Uplift Race'))
self.assertEquals(4, t.PointsPerCard('Abandoned Alien Uplift Camp'))
self.assertEquals(1, t.PointsPerCard('New Vinland'))
self.assertEquals(4, t.PointsPerCard('Devolved Uplift Race'))
def testK5995Tableau(self):
t = tableau_scorer.TableauScorer(['Imperium Warlord',
'Interstellar Bank',
'Expedition Force',
'Terraforming Robots',
'Former Penal Colony',
'Galactic Advertisers',
'Rebel Underground',
'Aquatic Uplift Race',
'Galactic Imperium',
'Hive World',
'Outlaw World',
'Gambling World'])
self.assertEquals(25, t.TotalPoints())
self.assertEquals(6, t.BonusPer6Dev('Galactic Imperium'))
def testR2540Tableau(self):
t = tableau_scorer.TableauScorer(["New Sparta",
"Blaster Runners",
"Rebel Warrior Race",
"Public Works",
"Lost Species Ark World",
"Alien Robot Scout Ship",
"Insect Uplift Race",
"Alien Uplift Center",
"Universal Symbionts",
"Galactic Federation",
"Rebel Alliance",
"Galactic Imperium",
"Primitive Rebel World"], 8)
self.assertEquals(53, t.TotalPoints())
if __name__ == '__main__':
unittest.main()