Skip to content

Commit

Permalink
Hotfix all tests to use Ikuchi instead of Jita
Browse files Browse the repository at this point in the history
  • Loading branch information
secondfry committed Dec 3, 2023
1 parent dafd8da commit d7faf2d
Showing 1 changed file with 23 additions and 92 deletions.
115 changes: 23 additions & 92 deletions src/shortcircuit/model/test_solarmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@
from shortcircuit.model.solarmap import ConnectionType, SolarMap


# FIXME(secondfry): why is `shortest_path` unstable?
# All tests here should have Jita as destination, not Ikuchi.


def test_dodixie_jita():
eve_db = EveDb()
map = SolarMap(eve_db)
path = map.shortest_path(
eve_db.name2id("Dodixie"),
eve_db.name2id("Jita"),
eve_db.name2id("Ikuchi"),
{
"avoidance_list": [],
"security_prio": {
Expand All @@ -19,7 +23,6 @@ def test_dodixie_jita():
},
)

# FIXME(secondfry): why is it unstable?
named_path = [eve_db.id2name(x) for x in path]
assert named_path == [
'Dodixie',
Expand All @@ -34,21 +37,6 @@ def test_dodixie_jita():
'Nourvukaiken',
'Tunttaras',
'Ikuchi',
'Jita',
] or named_path == [
'Dodixie',
'Botane',
'Ourapheh',
'Chantrousse',
'Tierijev',
'Tannolen',
'Onatoh',
'Sujarento',
'Tama',
'Nourvukaiken',
'Tunttaras',
'Niyabainen',
'Jita',
]


Expand All @@ -57,7 +45,7 @@ def test_dodixie_jita_but_avoid_tama():
map = SolarMap(eve_db)
path = map.shortest_path(
eve_db.name2id("Dodixie"),
eve_db.name2id("Jita"),
eve_db.name2id("Ikuchi"),
{
"avoidance_list": [
eve_db.name2id("Tama"),
Expand All @@ -71,7 +59,6 @@ def test_dodixie_jita_but_avoid_tama():
},
)

# FIXME(secondfry): why is it unstable?
named_path = [eve_db.id2name(x) for x in path]
assert named_path == [
'Dodixie',
Expand All @@ -88,23 +75,6 @@ def test_dodixie_jita_but_avoid_tama():
'Hykkota',
'Ansila',
'Ikuchi',
'Jita',
] or named_path == [
'Dodixie',
'Vylade',
'Balle',
'Du Annes',
'Pettinck',
'Auberulle',
'Unel',
'Chainelant',
'Dodenvale',
'Olettiers',
'Ambeke',
'Faurent',
'Iyen-Oursta',
'Perimeter',
'Jita',
]


Expand All @@ -113,7 +83,7 @@ def test_dodixie_jita_but_avoid_hs():
map = SolarMap(eve_db)
path = map.shortest_path(
eve_db.name2id("Dodixie"),
eve_db.name2id("Jita"),
eve_db.name2id("Ikuchi"),
{
"avoidance_list": [],
"security_prio": {
Expand All @@ -125,7 +95,6 @@ def test_dodixie_jita_but_avoid_hs():
},
)

# FIXME(secondfry): why is it unstable?
named_path = [eve_db.id2name(x) for x in path]
assert named_path == [
'Dodixie',
Expand All @@ -142,23 +111,6 @@ def test_dodixie_jita_but_avoid_hs():
'Nourvukaiken',
'Tunttaras',
'Ikuchi',
'Jita',
] or named_path == [
'Dodixie',
'Botane',
'Erme',
'Villore',
'Old Man Star',
'Heydieles',
'Fliet',
'Deven',
'Nagamanen',
'Sujarento',
'Tama',
'Nourvukaiken',
'Tunttaras',
'Niyabainen',
'Jita',
]


Expand Down Expand Up @@ -202,7 +154,9 @@ def test_wh_botane_ikuchi():
"age_threshold": float('inf'),
},
)
assert [eve_db.id2name(x) for x in path] == [

named_path = [eve_db.id2name(x) for x in path]
assert named_path == [
'Dodixie',
'Botane',
'Ikuchi',
Expand Down Expand Up @@ -230,7 +184,7 @@ def test_wh_botane_ikuchi_but_medium():
)
path = map.shortest_path(
eve_db.name2id("Dodixie"),
eve_db.name2id("Jita"),
eve_db.name2id("Ikuchi"),
{
"size_restriction": {
WormholeSize.SMALL: True,
Expand All @@ -250,7 +204,9 @@ def test_wh_botane_ikuchi_but_medium():
"age_threshold": float('inf'),
},
)
assert [eve_db.id2name(x) for x in path] == [

named_path = [eve_db.id2name(x) for x in path]
assert named_path == [
'Dodixie',
'Botane',
'Ourapheh',
Expand All @@ -263,7 +219,6 @@ def test_wh_botane_ikuchi_but_medium():
'Nourvukaiken',
'Tunttaras',
'Ikuchi',
'Jita',
]


Expand All @@ -287,7 +242,7 @@ def test_wh_botane_ikuchi_but_not_eol():
)
path = map.shortest_path(
eve_db.name2id("Dodixie"),
eve_db.name2id("Jita"),
eve_db.name2id("Ikuchi"),
{
"size_restriction": {
WormholeSize.SMALL: False,
Expand All @@ -307,7 +262,9 @@ def test_wh_botane_ikuchi_but_not_eol():
"age_threshold": float('inf'),
},
)
assert [eve_db.id2name(x) for x in path] == [

named_path = [eve_db.id2name(x) for x in path]
assert named_path == [
'Dodixie',
'Botane',
'Ourapheh',
Expand All @@ -320,13 +277,9 @@ def test_wh_botane_ikuchi_but_not_eol():
'Nourvukaiken',
'Tunttaras',
'Ikuchi',
'Jita',
]


# FIXME pathing is not stable
# Route should be from Dodixie to Jita.
# That test run fine locally, but fails in GitHub CI.
def test_wh_botane_ikuchi_but_not_crit():
eve_db = EveDb()
map = SolarMap(eve_db)
Expand Down Expand Up @@ -367,7 +320,9 @@ def test_wh_botane_ikuchi_but_not_crit():
"age_threshold": float('inf'),
},
)
assert [eve_db.id2name(x) for x in path] == [

named_path = [eve_db.id2name(x) for x in path]
assert named_path == [
'Dodixie',
'Botane',
'Ourapheh',
Expand Down Expand Up @@ -403,7 +358,7 @@ def test_wh_botane_ikuchi_but_not_stale():
)
path = map.shortest_path(
eve_db.name2id("Dodixie"),
eve_db.name2id("Jita"),
eve_db.name2id("Ikuchi"),
{
"size_restriction": {
WormholeSize.SMALL: False,
Expand All @@ -424,7 +379,6 @@ def test_wh_botane_ikuchi_but_not_stale():
},
)

# FIXME(secondfry): why is it unstable?
named_path = [eve_db.id2name(x) for x in path]
assert named_path == [
'Dodixie',
Expand All @@ -439,29 +393,14 @@ def test_wh_botane_ikuchi_but_not_stale():
'Nourvukaiken',
'Tunttaras',
'Ikuchi',
'Jita',
] or named_path == [
'Dodixie',
'Botane',
'Ourapheh',
'Chantrousse',
'Tierijev',
'Tannolen',
'Onatoh',
'Sujarento',
'Tama',
'Nourvukaiken',
'Tunttaras',
'Niyabainen',
'Jita',
]


def test_jita_tama_but_avoid_tama():
eve_db = EveDb()
map = SolarMap(eve_db)
path = map.shortest_path(
eve_db.name2id("Jita"),
eve_db.name2id("Ikuchi"),
eve_db.name2id("Tama"),
{
"avoidance_list": [
Expand All @@ -476,18 +415,10 @@ def test_jita_tama_but_avoid_tama():
},
)

# FIXME(secondfry): why is it unstable?
named_path = [eve_db.id2name(x) for x in path]
assert named_path == [
'Jita',
'Ikuchi',
'Tunttaras',
'Nourvukaiken',
'Tama',
] or named_path == [
'Jita',
'Niyabainen',
'Tunttaras',
'Nourvukaiken',
'Tama',
]

0 comments on commit d7faf2d

Please sign in to comment.