Skip to content

Commit

Permalink
Reject multiple research stations
Browse files Browse the repository at this point in the history
  • Loading branch information
CyberiaResurrection committed Nov 7, 2023
1 parent d430d5b commit e575a76
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions PyRoute/TradeCodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,11 @@ def is_well_formed(self):
msg = "Residual code " + str(code) + " not in allowed residual list"
return False, msg

research_stations = [code for code in self.codes if code.startswith('Rs')]
if 1 < len(research_stations):
msg = "At most one research station allowed"
return False, msg

result, msg = self._check_code_pairs_allowed()

return result, msg
Expand Down
1 change: 1 addition & 0 deletions Tests/Hypothesis/testDeltaStar.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,7 @@ def test_canonicalise_cx_on_non_barren_worlds(self, starline):
@example('2123 Medurma A9D7954-C Hi An Cs Di(Miyavine) Asla1 S\'mr0 { 3 } (G8E+1) [7C3A] BEF - - 823 12 ImDv G0 V Xb:1823 Xb:1926 Xb:2223 Xb:2225 Xb:2322')
@example('0101 0 A000400-0 As Ba { 0 } (001+0) [0000] - - A 000 0 NaHu G5 V')
@example('0101 0 A000000-0 Cp Cp Cp Cp Cp Cp Cp Cp Cp Cp { 0 } (000+0) [0000] - - A 000 0 NaHu G5 V')
@example('0101 0 A000600-0 Cp Cx Cs Mr Da RsA RsB RsG { 0 } (000+0) [0000] - - A 000 0 NaHu G5 V')
def test_canonicalise_from_regex_match_and_verify_idempotency(self, starline):
sector = Sector(' Core', ' 0, 0')
foo = DeltaStar.parse_line_into_star(starline, sector, 'fixed', 'fixed')
Expand Down

0 comments on commit e575a76

Please sign in to comment.