Beispiel #1
0
 def test_wait_does_not_initialize_pokemon(self):
     self.request_json.pop('active')
     self.request_json[constants.WAIT] = [True]
     split_request_message = ['', 'request', json.dumps(self.request_json)]
     request(self.battle, split_request_message)
     self.assertEqual(0, len(self.battle.user.reserve))
Beispiel #2
0
 def test_force_switch_initializes_5_reserve_pokemon(self):
     self.request_json.pop('active')
     self.request_json[constants.FORCE_SWITCH] = [True]
     split_request_message = ['', 'request', json.dumps(self.request_json)]
     request(self.battle, split_request_message)
     self.assertEqual(5, len(self.battle.user.reserve))
Beispiel #3
0
 def test_wait_properly_sets_wait_flag(self):
     self.request_json.pop('active')
     self.request_json[constants.WAIT] = [True]
     split_request_message = ['', 'request', json.dumps(self.request_json)]
     request(self.battle, split_request_message)
     self.assertEqual(True, self.battle.wait)
Beispiel #4
0
 def test_force_switch_properly_sets_the_force_switch_flag(self):
     self.request_json.pop('active')
     self.request_json[constants.FORCE_SWITCH] = [True]
     split_request_message = ['', 'request', json.dumps(self.request_json)]
     request(self.battle, split_request_message)
     self.assertEqual(True, self.battle.force_switch)
Beispiel #5
0
 def test_request_sets_force_switch_to_false(self):
     split_request_message = ['', 'request', json.dumps(self.request_json)]
     request(self.battle, split_request_message)
     self.assertEqual(False, self.battle.force_switch)
Beispiel #6
0
 def test_request_json_initializes_5_reserve_pokemon(self):
     split_request_message = ['', 'request', json.dumps(self.request_json)]
     request(self.battle, split_request_message)
     self.assertEqual(5, len(self.battle.user.reserve))
Beispiel #7
0
 def test_request_json_initializes_user_active_pkmn(self):
     split_request_message = ['', 'request', json.dumps(self.request_json)]
     request(self.battle, split_request_message)
     self.assertEqual("throh", self.battle.user.active.name)
Beispiel #8
0
 def test_request_json_initializes_user_name(self):
     split_request_message = ['', 'request', json.dumps(self.request_json)]
     request(self.battle, split_request_message)
     self.assertEqual("p1", self.battle.user.name)