@@ -395,7 +395,7 @@ def test_using_tiles_of_different_suit_for_chi(self):
395395 meld , _ = player .try_to_call_meld (tile , True )
396396 self .assertIsNotNone (meld )
397397
398- def test_call_chankan_and_bad_ukeire_after_call (self ):
398+ def test_call_upgrade_pon_and_bad_ukeire_after_call (self ):
399399 table = Table ()
400400 table .count_of_remaining_tiles = 10
401401
@@ -411,9 +411,10 @@ def test_call_chankan_and_bad_ukeire_after_call(self):
411411 self .assertEqual (len (table .player .tiles ), 13 )
412412 self .assertEqual (table .player .should_call_kan (tile , False ), None )
413413
414- def test_call_chankan_and_bad_ukeire_after_call_second (self ):
414+ def test_call_upgrade_pon_and_bad_ukeire_after_call_second_case (self ):
415415 table = Table ()
416416 table .count_of_remaining_tiles = 10
417+ player = table .player
417418
418419 tiles = self ._string_to_136_array (man = '3455567' , sou = '222' , honors = '666' )
419420 table .player .init_hand (tiles )
@@ -424,7 +425,31 @@ def test_call_chankan_and_bad_ukeire_after_call_second(self):
424425
425426 self .assertEqual (table .player .should_call_kan (tile , False ), None )
426427
427- def test_upgrade_opened_pon_to_kan (self ):
428+ player .draw_tile (tile )
429+ discarded_tile = player .discard_tile ()
430+
431+ self .assertEqual (self ._to_string ([discarded_tile ]), '3m' )
432+
433+ def test_call_upgrade_pon_and_bad_ukeire_after_call_third_case (self ):
434+ table = Table ()
435+ table .count_of_remaining_tiles = 10
436+ player = table .player
437+
438+ tiles = self ._string_to_136_array (man = '67' , pin = '6' , sou = '1344478999' )
439+ table .player .init_hand (tiles )
440+ table .player .add_called_meld (self ._make_meld (Meld .PON , sou = '444' ))
441+
442+ tile = self ._string_to_136_tile (sou = '4' )
443+
444+ # we don't want to call shouminkan here
445+ self .assertEqual (table .player .should_call_kan (tile , False ), None )
446+
447+ player .draw_tile (tile )
448+ discarded_tile = player .discard_tile ()
449+
450+ self .assertEqual (self ._to_string ([discarded_tile ]), '6p' )
451+
452+ def test_call_shouminkan (self ):
428453 table = Table ()
429454 table .count_of_remaining_tiles = 10
430455
@@ -476,8 +501,7 @@ def test_opened_kan(self):
476501 tile = self ._string_to_136_tile (sou = '1' )
477502 self .assertEqual (table .player .should_call_kan (tile , True ), None )
478503
479- # test case 2
480-
504+ def test_opened_kan_second_case (self ):
481505 table = Table ()
482506 table .count_of_remaining_tiles = 10
483507
@@ -493,7 +517,7 @@ def test_opened_kan(self):
493517 tile = self ._string_to_136_tile (sou = '1' )
494518 self .assertEqual (table .player .should_call_kan (tile , True ), Meld .KAN )
495519
496- # test case 3
520+ def test_opened_kan_third_case ( self ):
497521 # we are in tempai already and there was a crash on 5s meld suggestion
498522
499523 table = Table ()
0 commit comments