Add public distance chat command
This commit is contained in:
1 parent
492238aa22
commit
d62e745fa6
3 files changed
+39
-1
No files matched your search
@@ -208,6 +208,21 @@ class TestModernChat(unittest.TestCase):
|
||||
('DM', 'tanner', 'tanner -> me: !ping', 'tanner'),
|
||||
])
|
||||
|
||||
def test_public_distance_command_uses_requesting_player_position(self):
|
||||
player_uuid = 'f6126022-2c68-37f7-be93-aaa551374663'
|
||||
chat = FakeChat()
|
||||
command = Commands.__new__(Commands)
|
||||
command.g = Munch(
|
||||
name='mosfet1', pos=(0, 64, 0), chat=chat,
|
||||
players={12: Munch(
|
||||
player_uuid=player_uuid, x=3.0, y=68.0, z=0.0)},
|
||||
player_names={player_uuid: 'tanner'},
|
||||
)
|
||||
|
||||
command.handle_chat(('CHAT', player_uuid, 'tanner: !dist'))
|
||||
|
||||
self.assertEqual(chat.messages, ['you are 5.0 blocks away'])
|
||||
|
||||
def test_dm_command_replies_to_named_sender(self):
|
||||
chat = FakeChat()
|
||||
command = Commands.__new__(Commands)
|
||||
|
||||
Reference in new issue
Block a user