mirror of
https://github.com/veekun/pokedex.git
synced 2024-08-20 18:16:34 +00:00
This commit is contained in:
parent
3651810467
commit
4414bab714
4 changed files with 3781 additions and 3724 deletions
|
@ -31,40 +31,40 @@ id,version_group_id,encounter_terrain_id,slot,rarity
|
||||||
30,8,5,3,5
|
30,8,5,3,5
|
||||||
31,8,5,4,4
|
31,8,5,4,4
|
||||||
32,8,5,5,1
|
32,8,5,5,1
|
||||||
33,9,1,1,20
|
33,10,1,1,20
|
||||||
34,9,1,2,20
|
34,10,1,2,20
|
||||||
35,9,1,3,10
|
35,10,1,3,10
|
||||||
36,9,1,4,10
|
36,10,1,4,10
|
||||||
37,9,1,5,10
|
37,10,1,5,10
|
||||||
38,9,1,6,10
|
38,10,1,6,10
|
||||||
39,9,1,7,5
|
39,10,1,7,5
|
||||||
40,9,1,8,5
|
40,10,1,8,5
|
||||||
41,9,1,9,4
|
41,10,1,9,4
|
||||||
42,9,1,10,4
|
42,10,1,10,4
|
||||||
43,9,1,11,1
|
43,10,1,11,1
|
||||||
44,9,1,12,1
|
44,10,1,12,1
|
||||||
45,9,2,1,40
|
45,10,2,1,40
|
||||||
46,9,2,2,30
|
46,10,2,2,30
|
||||||
47,9,2,3,15
|
47,10,2,3,15
|
||||||
48,9,2,4,10
|
48,10,2,4,10
|
||||||
49,9,2,5,5
|
49,10,2,5,5
|
||||||
50,9,3,1,40
|
50,10,3,1,40
|
||||||
51,9,3,2,30
|
51,10,3,2,30
|
||||||
52,9,3,3,15
|
52,10,3,3,15
|
||||||
53,9,3,4,10
|
53,10,3,4,10
|
||||||
54,9,3,5,5
|
54,10,3,5,5
|
||||||
55,9,4,1,40
|
55,10,4,1,40
|
||||||
56,9,4,2,30
|
56,10,4,2,30
|
||||||
57,9,4,3,15
|
57,10,4,3,15
|
||||||
58,9,4,4,10
|
58,10,4,4,10
|
||||||
59,9,4,5,5
|
59,10,4,5,5
|
||||||
60,9,5,1,60
|
60,10,5,1,60
|
||||||
61,9,5,2,30
|
61,10,5,2,30
|
||||||
62,9,5,3,5
|
62,10,5,3,5
|
||||||
63,9,5,4,4
|
63,10,5,4,4
|
||||||
64,9,5,5,1
|
64,10,5,5,1
|
||||||
65,9,6,1,90
|
65,10,6,1,90
|
||||||
66,9,6,2,10
|
66,10,6,2,10
|
||||||
67,1,1,1,20
|
67,1,1,1,20
|
||||||
68,1,1,2,20
|
68,1,1,2,20
|
||||||
69,1,1,3,15
|
69,1,1,3,15
|
||||||
|
@ -121,3 +121,35 @@ id,version_group_id,encounter_terrain_id,slot,rarity
|
||||||
120,2,4,2,30
|
120,2,4,2,30
|
||||||
121,2,4,3,20
|
121,2,4,3,20
|
||||||
122,2,4,4,10
|
122,2,4,4,10
|
||||||
|
123,9,1,1,20
|
||||||
|
124,9,1,2,20
|
||||||
|
125,9,1,3,10
|
||||||
|
126,9,1,4,10
|
||||||
|
127,9,1,5,10
|
||||||
|
128,9,1,6,10
|
||||||
|
129,9,1,7,5
|
||||||
|
130,9,1,8,5
|
||||||
|
131,9,1,9,4
|
||||||
|
132,9,1,10,4
|
||||||
|
133,9,1,11,1
|
||||||
|
134,9,1,12,1
|
||||||
|
135,9,2,1,60
|
||||||
|
136,9,2,2,30
|
||||||
|
137,9,2,3,5
|
||||||
|
138,9,2,4,4
|
||||||
|
139,9,2,5,1
|
||||||
|
140,9,3,1,40
|
||||||
|
141,9,3,2,40
|
||||||
|
142,9,3,3,15
|
||||||
|
143,9,3,4,4
|
||||||
|
144,9,3,5,1
|
||||||
|
145,9,4,1,40
|
||||||
|
146,9,4,2,40
|
||||||
|
147,9,4,3,15
|
||||||
|
148,9,4,4,4
|
||||||
|
149,9,4,5,1
|
||||||
|
150,9,5,1,60
|
||||||
|
151,9,5,2,30
|
||||||
|
152,9,5,3,5
|
||||||
|
153,9,5,4,4
|
||||||
|
154,9,5,5,1
|
||||||
|
|
|
File diff suppressed because it is too large
Load diff
|
@ -1377,6 +1377,7 @@ EncounterConditionValueMap.condition_value = relation(EncounterConditionValue,
|
||||||
backref='encounter_map')
|
backref='encounter_map')
|
||||||
|
|
||||||
EncounterSlot.terrain = relation(EncounterTerrain, backref='slots')
|
EncounterSlot.terrain = relation(EncounterTerrain, backref='slots')
|
||||||
|
EncounterSlot.version_group = relation(VersionGroup)
|
||||||
|
|
||||||
EncounterSlot.condition_map = relation(EncounterSlotCondition, backref='slot')
|
EncounterSlot.condition_map = relation(EncounterSlotCondition, backref='slot')
|
||||||
EncounterSlot.conditions = association_proxy('condition_map', 'condition')
|
EncounterSlot.conditions = association_proxy('condition_map', 'condition')
|
||||||
|
|
24
pokedex/tests/test_database_sanity.py
Normal file
24
pokedex/tests/test_database_sanity.py
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
from nose.tools import *
|
||||||
|
import unittest
|
||||||
|
from sqlalchemy.orm import aliased
|
||||||
|
|
||||||
|
from pokedex.db import connect, tables
|
||||||
|
|
||||||
|
def test_encounter_slots():
|
||||||
|
# Encounters have a version, which has a version group; encounters also
|
||||||
|
# have an encounter_slot, which has a version group. The two version
|
||||||
|
# groups should match, universally.
|
||||||
|
session = connect()
|
||||||
|
|
||||||
|
version_group_a = aliased(tables.VersionGroup)
|
||||||
|
version_group_b = aliased(tables.VersionGroup)
|
||||||
|
|
||||||
|
sanity_q = session.query(tables.Encounter) \
|
||||||
|
.join((tables.EncounterSlot, tables.Encounter.slot)) \
|
||||||
|
.join((version_group_a, tables.EncounterSlot.version_group)) \
|
||||||
|
.join((tables.Version, tables.Encounter.version)) \
|
||||||
|
.join((version_group_b, tables.Version.version_group)) \
|
||||||
|
.filter(version_group_a.id != version_group_b.id)
|
||||||
|
|
||||||
|
assert_equal(sanity_q.count(), 0,
|
||||||
|
"Encounter slots all match the encounters they belong to")
|
Loading…
Reference in a new issue