-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest_edit_message_text_method.py
62 lines (46 loc) · 2.53 KB
/
test_edit_message_text_method.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
'''
API tests for editMessageText method
\nCommand to start editMessageText tests: pytest . -s -m editmessage
'''
import pytest
from telegram_api_tests import TEST_USER_ID
from telegram_api_tests.api_requests.edit_message import EditMessageTextRequest
@pytest.mark.editmessage
class TestEditMessageTextMethod():
@pytest.fixture(scope="class", autouse=True)
def setup(self):
global request
request = EditMessageTextRequest('sendMessage', chat_id=TEST_USER_ID, text='test message')
request.send()
request.should_be_status_ok()
request.should_be_status_code_200()
message_id = request.response.json()["result"]["message_id"]
request = EditMessageTextRequest('editMessageText', chat_id=TEST_USER_ID, message_id=message_id,
text='edited message')
request.send()
def test_edit_message_text_request_should_return_status_ok(self):
request.should_be_status_ok()
def test_edit_message_text_request_should_return_status_code_200(self):
request.should_be_status_code_200()
def test_edit_message_text_request_should_return_result_of_request(self):
request.should_be_result_of_request_in_response()
def test_edit_message_text_request_should_return_correct_bot_id(self):
request.should_be_correct_id_of_bot()
def test_edit_message_text_request_should_return_correct_is_bot_status(self):
request.should_be_response_from_a_bot()
def test_edit_message_text_request_should_return_correct_first_name_of_a_bot(self):
request.should_be_correct_first_name_of_a_bot()
def test_edit_message_text_request_should_return_correct_username_of_a_bot(self):
request.should_be_correct_username_of_a_bot()
def test_edit_message_text_request_should_return_correct_receiver_id(self):
request.should_be_correct_receiver_id()
def test_edit_message_text_request_should_return_correct_receiver_first_name(self):
request.should_be_correct_receiver_first_name()
def test_edit_message_text_request_should_return_correct_receiver_last_name(self):
request.should_be_correct_receiver_last_name()
def test_edit_message_text_request_should_return_correct_receiver_username(self):
request.should_be_correct_receiver_username()
def test_edit_message_text_request_should_return_correct_chat_type(self):
request.should_be_correct_chat_type()
def test_edit_message_text_request_should_return_correct_message_text(self):
request.should_be_correct_message_text()