This repository was archived by the owner on Jul 8, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -140,7 +140,7 @@ def get_player(self, player_seat):
140140 return self .players [player_seat ]
141141
142142 def get_players_sorted_by_scores (self ):
143- return sorted (self .players , key = lambda x : x .scores , reverse = True )
143+ return sorted (self .players , key = lambda x : x .scores or 0 , reverse = True )
144144
145145 @property
146146 def round_wind (self ):
Original file line number Diff line number Diff line change 88
99class TenhouClientTestCase (unittest .TestCase ):
1010
11+ def setUp (self ):
12+ self .client = None
13+
14+ def tearDown (self ):
15+ self .client .end_game (False )
16+
1117 def test_fixed_crash_after_called_kan (self ):
1218 log = """
1319 Get: <HELO uname="Name" auth="20170415-1111111" />
@@ -63,14 +69,14 @@ def test_fixed_crash_after_called_kan(self):
6369 Get: <N who="0" m="30211" /> <T39/>
6470 """
6571
66- client = TenhouClient (SocketMock (None , log ))
72+ self . client = TenhouClient (SocketMock (None , log ))
6773 with self .assertRaises (KeyboardInterrupt ) as context :
68- client .connect ()
69- client .authenticate ()
70- client .start_game ()
74+ self . client .connect ()
75+ self . client .authenticate ()
76+ self . client .start_game ()
7177
7278 # close all threads
73- client .end_game ()
79+ self . client .end_game ()
7480
7581 # end of commands is correct way to end log reproducing
7682 self .assertTrue ('End of commands' in str (context .exception ))
You can’t perform that action at this time.
0 commit comments