def test_team_join(self): prot = Mock() prot.team_class = Team server.ServerProtocol._create_teams(prot) # Some places still use the old name prot.players = {} for team in (prot.team_1, prot.team_2, prot.team_spectator): ply = player.ServerConnection(prot, Mock()) ply.spawn = Mock() ex_ply = contained.ExistingPlayer() ex_ply.team = team.id ply.on_new_player_recieved(ex_ply) self.assertEqual(ply.team, team)
from pyspades import world from pyspades.common import Vertex3, get_color, make_color from pyspades.weapon import WEAPONS from pyspades.mapgenerator import ProgressiveMapGenerator set_tool = loaders.SetTool() block_action = loaders.BlockAction() position_data = loaders.PositionData() restock = loaders.Restock() create_player = loaders.CreatePlayer() intel_pickup = loaders.IntelPickup() intel_capture = loaders.IntelCapture() intel_drop = loaders.IntelDrop() player_left = loaders.PlayerLeft() set_hp = loaders.SetHP() existing_player = loaders.ExistingPlayer() kill_action = loaders.KillAction() chat_message = loaders.ChatMessage() map_data = loaders.MapChunk() map_start = loaders.MapStart() state_data = loaders.StateData() ctf_data = loaders.CTFState() tc_data = loaders.TCState() change_weapon = loaders.ChangeWeapon() weapon_reload = loaders.WeaponReload() handshake_init = loaders.HandShakeInit() version_request = loaders.VersionRequest() def check_nan(*values): for value in values: