Join GitHub today
Make chat_id a positional argument inside shortcut methods of Chat and User classes #1048 #1050
Ok, I have tried to figure out how they work but I am not entirely sure... would something like that work for test_chat.py for example?
def test_instance_method_send_message(self, monkeypatch, chat): def test(*args, **kwargs): return args == chat.id and args == 'test' monkeypatch.setattr('telegram.Bot.send_message', test) assert chat.send_message('test') def test_instance_method_send_audio(self, monkeypatch, chat): def test(*args, **kwargs): return args == chat.id and args == 'test_audio' monkeypatch.setattr('telegram.Bot.send_audio', test) assert chat.send_audio('test_audio')
Moreover, I have noticed that both Chat and User classes lack the tests for
@xates Looks like you didn't follow this step from the contributing guide:
To fix it run: