repo_id
stringclasses
409 values
prefix
large_stringlengths
34
36.3k
target
large_stringlengths
1
498
assertion_type
stringclasses
31 values
difficulty
stringclasses
8 values
test_file
stringlengths
10
121
test_function
stringlengths
1
104
test_class
stringlengths
0
51
lineno
int32
2
11.3k
commit_idx
int32
david-lev/pywa
import asyncio import threading import time import pytest from pywa import WhatsApp as WhatsAppSync from pywa import filters from pywa.listeners import ( ListenerCanceled, ListenerStopped, ListenerTimeout, UserUpdateListenerIdentifier, ) from pywa_async import WhatsApp as WhatsAppAsync def wa_sync():...
ListenerStopped)
pytest.raises
variable
tests/test_listeners.py
test_listener_stopped_sync
127
null
david-lev/pywa
import dataclasses import datetime import io import json import pathlib from unittest import mock import pytest from pywa import WhatsApp, filters, types, utils from pywa import _helpers as helpers from pywa._helpers import MediaSource from pywa.types import Contact from pywa.types.media import Media PHONE_ID = "123...
ValueError)
pytest.raises
variable
tests/test_client.py
test_resolve_waba_id_param
379
null
david-lev/pywa
import datetime import functools from types import ModuleType import pytest from pywa import WhatsApp, filters, handlers, types from pywa.handlers import FlowRequestHandler, _flow_request_handler_attr from pywa.types import Message from pywa_async import WhatsApp as WhatsAppAsync FAKE_WA = WhatsApp(phone_id="1234567...
class_without_parentheses
assert
variable
tests/test_handlers.py
test_class_without_parentheses
99
null
david-lev/pywa
import dataclasses from typing import Optional import pytest from pywa.types import CallbackData def test_data(): """Test the callback data.""" @dataclasses.dataclass(slots=True, frozen=True) class User(CallbackData): __callback_id__ = "x" id: int name: str is_admin: bool...
"x~1234~xxx~§"
assert
string_literal
tests/test_callback_data.py
test_data
80
null
david-lev/pywa
import datetime from unittest.mock import MagicMock, call import pytest from pywa import WhatsApp, types from pywa.types import Result from pywa.types.flows import FlowDetails from pywa.types.sent_update import ( InitiatedCall, SentMessage, SentTemplate, SentTemplateStatus, ) wa = WhatsApp(phone_id="...
r
assert
variable
tests/test_types.py
test_repr
471
null
david-lev/pywa
import datetime import importlib import json import pathlib import pytest from pywa import _helpers as helpers from pywa import types from pywa.types import flows from pywa.types.templates import * # noqa: F403 def _resolve_example_handles(template: Template): not_uploaded = helpers._filter_not_uploaded_comps(t...
ValueError, match="Missing parameters for: BodyText$")
pytest.raises
complex_expr
tests/test_templates.py
test_validate_template_params
764
null
david-lev/pywa
import dataclasses import datetime import io import json import pathlib from unittest import mock import pytest from pywa import WhatsApp, filters, types, utils from pywa import _helpers as helpers from pywa._helpers import MediaSource from pywa.types import Contact from pywa.types.media import Media PHONE_ID = "123...
WABA_ID
assert
variable
tests/test_client.py
test_resolve_waba_id_param
360
null
david-lev/pywa
import inspect import pytest from pywa import WhatsApp as WhatsAppSync from pywa.api import GraphAPI as GraphAPISync from pywa.handlers import _HandlerDecorators from pywa.listeners import _Listeners as ListenersSync from pywa.server import Server as ServerSync from pywa.types import ( CallbackButton as CallbackB...
len( WhatsAppAsync._handlers_to_updates )
assert
func_call
tests/test_async.py
test_all_handlers_to_updates_are_overwritten_in_async
484
null
david-lev/pywa
import dataclasses import datetime import io import json import pathlib from unittest import mock import pytest from pywa import WhatsApp, filters, types, utils from pywa import _helpers as helpers from pywa._helpers import MediaSource from pywa.types import Contact from pywa.types.media import Media PHONE_ID = "123...
"Bearer abc"
assert
string_literal
tests/test_client.py
test_token
568
null
david-lev/pywa
import datetime import importlib import json import pathlib import pytest from pywa import _helpers as helpers from pywa import types from pywa.types import flows from pywa.types.templates import * # noqa: F403 def _resolve_example_handles(template: Template): not_uploaded = helpers._filter_not_uploaded_comps(t...
ValueError, match="Missing parameters for Carousel component.")
pytest.raises
complex_expr
tests/test_templates.py
test_validate_template_params
781
null
david-lev/pywa
import datetime import importlib import json import pathlib import pytest from pywa import _helpers as helpers from pywa import types from pywa.types import flows from pywa.types.templates import * # noqa: F403 def _resolve_example_handles(template: Template): not_uploaded = helpers._filter_not_uploaded_comps(t...
"Hi David, this is a text template number 2"
assert
string_literal
tests/test_templates.py
test_template_text_examples_named
121
null
david-lev/pywa
import datetime from unittest.mock import MagicMock, call import pytest from pywa import WhatsApp, types from pywa.types import Result from pywa.types.flows import FlowDetails from pywa.types.sent_update import ( InitiatedCall, SentMessage, SentTemplate, SentTemplateStatus, ) wa = WhatsApp(phone_id="...
True
assert
bool_literal
tests/test_types.py
test_result_properties
366
null
david-lev/pywa
import datetime import functools from types import ModuleType import pytest from pywa import WhatsApp, filters, handlers, types from pywa.handlers import FlowRequestHandler, _flow_request_handler_attr from pywa.types import Message from pywa_async import WhatsApp as WhatsAppAsync FAKE_WA = WhatsApp(phone_id="1234567...
class_with_parentheses_kw
assert
variable
tests/test_handlers.py
test_class_with_parentheses_kw
72
null
david-lev/pywa
import datetime from unittest.mock import MagicMock, call import pytest from pywa import WhatsApp, types from pywa.types import Result from pywa.types.flows import FlowDetails from pywa.types.sent_update import ( InitiatedCall, SentMessage, SentTemplate, SentTemplateStatus, ) wa = WhatsApp(phone_id="...
"Alice"
assert
string_literal
tests/test_types.py
test_result_behavior
360
null
david-lev/pywa
import dataclasses import datetime import io import json import pathlib from unittest import mock import pytest from pywa import WhatsApp, filters, types, utils from pywa import _helpers as helpers from pywa._helpers import MediaSource from pywa.types import Contact from pywa.types.media import Media PHONE_ID = "123...
"1234567890"
assert
string_literal
tests/test_client.py
test_resolve_phone_id_param
395
null
david-lev/pywa
from unittest.mock import Mock import pytest from pywa import utils as pywa_utils from pywa.server import ContinueHandling, Server, StopHandling def test_default_flow_request_decryptor_encryptor(): payload = { "encrypted_flow_data": "sCTmBCqjs0GkkX6n/nyZDuyjpaijuelY3I/8rlr1ZIEymEzCMnDGQdxQ9OGaKw0CEaWSgc/...
"FBEoV73B8mnSt+nzfurVK704zkwHsr1uu/m953h5vNdri5G4Pe/BoDTh6SgzgjrrZ4iP12GO3kti8YW7Tn1KibKaRf8LE/gps2ATJq3nWSCI"
assert
string_literal
tests/test_server.py
test_default_flow_request_decryptor_encryptor
73
null
david-lev/pywa
import datetime import importlib import json import pathlib import pytest from pywa import _helpers as helpers from pywa import types from pywa.types import flows from pywa.types.templates import * # noqa: F403 def _resolve_example_handles(template: Template): not_uploaded = helpers._filter_not_uploaded_comps(t...
{"name": "David", "number": 1}
assert
collection
tests/test_templates.py
test_template_text_examples_named
119
null
david-lev/pywa
import datetime import importlib import json import pathlib import pytest from pywa import _helpers as helpers from pywa import types from pywa.types import flows from pywa.types.templates import * # noqa: F403 def _resolve_example_handles(template: Template): not_uploaded = helpers._filter_not_uploaded_comps(t...
{ "type": "BUTTONS", "buttons": [], }
assert
collection
tests/test_templates.py
test_comp_and_params_to_dict
281
null
david-lev/pywa
import datetime from unittest.mock import MagicMock, call import pytest from pywa import WhatsApp, types from pywa.types import Result from pywa.types.flows import FlowDetails from pywa.types.sent_update import ( InitiatedCall, SentMessage, SentTemplate, SentTemplateStatus, ) wa = WhatsApp(phone_id="...
"xyz"
assert
string_literal
tests/test_types.py
test_result_properties
369
null
david-lev/pywa
from unittest.mock import Mock import pytest from pywa import utils as pywa_utils from pywa.server import ContinueHandling, Server, StopHandling def test_default_flow_request_decryptor_encryptor(): payload = { "encrypted_flow_data": "sCTmBCqjs0GkkX6n/nyZDuyjpaijuelY3I/8rlr1ZIEymEzCMnDGQdxQ9OGaKw0CEaWSgc/...
{ "data": {}, "flow_token": "my_flow_token", "screen": "", "action": "INIT", "version": "3.0", }
assert
collection
tests/test_server.py
test_default_flow_request_decryptor_encryptor
65
null
david-lev/pywa
import datetime import functools from types import ModuleType import pytest from pywa import WhatsApp, filters, handlers, types from pywa.handlers import FlowRequestHandler, _flow_request_handler_attr from pywa.types import Message from pywa_async import WhatsApp as WhatsAppAsync FAKE_WA = WhatsApp(phone_id="1234567...
5
assert
numeric_literal
tests/test_handlers.py
test_all_combinations
117
null
david-lev/pywa
import datetime import importlib import json import pathlib import pytest from pywa import _helpers as helpers from pywa import types from pywa.types import flows from pywa.types.templates import * # noqa: F403 def _resolve_example_handles(template: Template): not_uploaded = helpers._filter_not_uploaded_comps(t...
{ "type": "CALL_PERMISSION_REQUEST", }
assert
collection
tests/test_templates.py
test_comp_and_params_to_dict
554
null
david-lev/pywa
import dataclasses import datetime import io import json import pathlib from unittest import mock import pytest from pywa import WhatsApp, filters, types, utils from pywa import _helpers as helpers from pywa._helpers import MediaSource from pywa.types import Contact from pywa.types.media import Media PHONE_ID = "123...
"987654321"
assert
string_literal
tests/test_client.py
test_resolve_waba_id_param
369
null
david-lev/pywa
import datetime import functools from types import ModuleType import pytest from pywa import WhatsApp, filters, handlers, types from pywa.handlers import FlowRequestHandler, _flow_request_handler_attr from pywa.types import Message from pywa_async import WhatsApp as WhatsAppAsync FAKE_WA = WhatsApp(phone_id="1234567...
[]
assert
collection
tests/test_handlers.py
test_remove_handlers
157
null
david-lev/pywa
import dataclasses import datetime import importlib import json import pathlib from typing import Callable import pytest from pywa import WhatsApp, filters, handlers, utils from pywa.handlers import FlowCompletionHandler from pywa.types.flows import ( ComponentRef, DataSource, FlowJSON, FlowPreview, ...
main_handler
assert
variable
tests/test_flows.py
test_flow_callback_wrapper_main_handler
645
null
david-lev/pywa
import dataclasses from typing import Optional import pytest from pywa.types import CallbackData def test_data(): """Test the callback data.""" @dataclasses.dataclass(slots=True, frozen=True) class User(CallbackData): __callback_id__ = "x" id: int name: str is_admin: bool...
"x~3456~yyy~"
assert
string_literal
tests/test_callback_data.py
test_data
81
null
david-lev/pywa
import inspect import pytest from pywa import WhatsApp as WhatsAppSync from pywa.api import GraphAPI as GraphAPISync from pywa.handlers import _HandlerDecorators from pywa.listeners import _Listeners as ListenersSync from pywa.server import Server as ServerSync from pywa.types import ( CallbackButton as CallbackB...
async_sig
assert
variable
tests/test_async.py
test_same_signature
394
null
david-lev/pywa
import datetime import importlib import json import pathlib import pytest from pywa import _helpers as helpers from pywa import types from pywa.types import flows from pywa.types.templates import * # noqa: F403 def _resolve_example_handles(template: Template): not_uploaded = helpers._filter_not_uploaded_comps(t...
ValueError)
pytest.raises
variable
tests/test_templates.py
test_template_text_examples_params
54
null
david-lev/pywa
import datetime import functools from types import ModuleType import pytest from pywa import WhatsApp, filters, handlers, types from pywa.handlers import FlowRequestHandler, _flow_request_handler_attr from pywa.types import Message from pywa_async import WhatsApp as WhatsAppAsync FAKE_WA = WhatsApp(phone_id="1234567...
c
assert
variable
tests/test_handlers.py
test_get_flow_request_handler
190
null
david-lev/pywa
import datetime from unittest.mock import MagicMock, call import pytest from pywa import WhatsApp, types from pywa.types import Result from pywa.types.flows import FlowDetails from pywa.types.sent_update import ( InitiatedCall, SentMessage, SentTemplate, SentTemplateStatus, ) wa = WhatsApp(phone_id="...
[{"name": "Dave"}]
assert
collection
tests/test_types.py
test_previous_result
415
null
david-lev/pywa
from pywa import errors exceptions: dict[type[errors.WhatsAppError], dict] = { errors.MediaUploadError: { "code": 131053, "title": "Media upload error", "message": "Media upload error", "error_data": { "details": "Downloading media from weblink failed with http code 429,...
data.get("type")
assert
func_call
tests/test_errors.py
test_error_codes
38
null
david-lev/pywa
import asyncio import threading import time import pytest from pywa import WhatsApp as WhatsAppSync from pywa import filters from pywa.listeners import ( ListenerCanceled, ListenerStopped, ListenerTimeout, UserUpdateListenerIdentifier, ) from pywa_async import WhatsApp as WhatsAppAsync def wa_sync():...
ListenerCanceled)
pytest.raises
variable
tests/test_listeners.py
test_listener_canceled_sync
97
null
david-lev/pywa
import datetime import importlib import json import pathlib import pytest from pywa import _helpers as helpers from pywa import types from pywa.types import flows from pywa.types.templates import * # noqa: F403 def _resolve_example_handles(template: Template): not_uploaded = helpers._filter_not_uploaded_comps(t...
template_json
assert
variable
tests/test_templates.py
test_templates_to_json
34
null
david-lev/pywa
import dataclasses import datetime import io import json import pathlib from unittest import mock import pytest from pywa import WhatsApp, filters, types, utils from pywa import _helpers as helpers from pywa._helpers import MediaSource from pywa.types import Contact from pywa.types.media import Media PHONE_ID = "123...
"image.jpg"
assert
string_literal
tests/test_client.py
test_resolve_media_param
491
null
david-lev/pywa
import datetime from unittest.mock import MagicMock, call import pytest from pywa import WhatsApp, types from pywa.types import Result from pywa.types.flows import FlowDetails from pywa.types.sent_update import ( InitiatedCall, SentMessage, SentTemplate, SentTemplateStatus, ) wa = WhatsApp(phone_id="...
"16506666666"
assert
string_literal
tests/test_types.py
test_initiated_call
304
null
david-lev/pywa
import dataclasses import datetime import importlib import json import pathlib from typing import Callable import pytest from pywa import WhatsApp, filters, handlers, utils from pywa.handlers import FlowCompletionHandler from pywa.types.flows import ( ComponentRef, DataSource, FlowJSON, FlowPreview, ...
"SUCCESS"
assert
string_literal
tests/test_flows.py
test_flow_response_with_close_flow
566
null
david-lev/pywa
import datetime import importlib import json import pathlib import pytest from pywa import _helpers as helpers from pywa import types from pywa.types import flows from pywa.types.templates import * # noqa: F403 def _resolve_example_handles(template: Template): not_uploaded = helpers._filter_not_uploaded_comps(t...
"Hi {{name}}, this is a text template number {{number}}"
assert
string_literal
tests/test_templates.py
test_template_text_examples_named
118
null
david-lev/pywa
import inspect import pytest from pywa import WhatsApp as WhatsAppSync from pywa.api import GraphAPI as GraphAPISync from pywa.handlers import _HandlerDecorators from pywa.listeners import _Listeners as ListenersSync from pywa.server import Server as ServerSync from pywa.types import ( CallbackButton as CallbackB...
update
assert
variable
tests/test_async.py
test_all_handlers_to_updates_are_overwritten_in_async
490
null
david-lev/pywa
import datetime import importlib import json import pathlib import pytest from pywa import _helpers as helpers from pywa import types from pywa.types import flows from pywa.types.templates import * # noqa: F403 def _resolve_example_handles(template: Template): not_uploaded = helpers._filter_not_uploaded_comps(t...
"Hi David, this is a text template number 1"
assert
string_literal
tests/test_templates.py
test_template_text_examples_positionals
74
null
david-lev/pywa
import dataclasses import datetime import importlib import json import pathlib from typing import Callable import pytest from pywa import WhatsApp, filters, handlers, utils from pywa.handlers import FlowCompletionHandler from pywa.types.flows import ( ComponentRef, DataSource, FlowJSON, FlowPreview, ...
on_error
assert
variable
tests/test_flows.py
test_flow_callback_wrapper_on_error
700
null
david-lev/pywa
from unittest.mock import Mock import pytest from pywa import utils as pywa_utils from pywa.server import ContinueHandling, Server, StopHandling def mock_handler(mocker): handler = mocker.Mock() handler.handle = mocker.Mock() return handler def mock_update(mocker): return mocker.Mock() def server_w...
mock_update)
assert_*
variable
tests/test_server.py
test_invoke_callbacks_calls_all_handlers
139
null
david-lev/pywa
import datetime import functools from types import ModuleType import pytest from pywa import WhatsApp, filters, handlers, types from pywa.handlers import FlowRequestHandler, _flow_request_handler_attr from pywa.types import Message from pywa_async import WhatsApp as WhatsAppAsync FAKE_WA = WhatsApp(phone_id="1234567...
instance_with_parentheses
assert
variable
tests/test_handlers.py
test_instance_with_parentheses
47
null
david-lev/pywa
import datetime import functools from types import ModuleType import pytest from pywa import WhatsApp, filters, handlers, types from pywa.handlers import FlowRequestHandler, _flow_request_handler_attr from pywa.types import Message from pywa_async import WhatsApp as WhatsAppAsync FAKE_WA = WhatsApp(phone_id="1234567...
callback
assert
variable
tests/test_handlers.py
test_get_flow_request_handler
195
null
david-lev/pywa
import dataclasses import datetime import importlib import json import pathlib from typing import Callable import pytest from pywa import WhatsApp, filters, handlers, utils from pywa.handlers import FlowCompletionHandler from pywa.types.flows import ( ComponentRef, DataSource, FlowJSON, FlowPreview, ...
"${data.test}"
assert
string_literal
tests/test_flows.py
test_screen_data_ref
84
null
david-lev/pywa
import asyncio import threading import time import pytest from pywa import WhatsApp as WhatsAppSync from pywa import filters from pywa.listeners import ( ListenerCanceled, ListenerStopped, ListenerTimeout, UserUpdateListenerIdentifier, ) from pywa_async import WhatsApp as WhatsAppAsync def wa_sync():...
ListenerTimeout)
pytest.raises
variable
tests/test_listeners.py
test_listener_timeout_sync
67
null
david-lev/pywa
import datetime import importlib import json import pathlib import pytest from pywa import _helpers as helpers from pywa import types from pywa.types import flows from pywa.types.templates import * # noqa: F403 def _resolve_example_handles(template: Template): not_uploaded = helpers._filter_not_uploaded_comps(t...
ValueError, match="Missing parameters for: HeaderText, BodyText$")
pytest.raises
complex_expr
tests/test_templates.py
test_validate_template_params
888
null
david-lev/pywa
import dataclasses from typing import Optional import pytest from pywa.types import CallbackData def test_data(): """Test the callback data.""" @dataclasses.dataclass(slots=True, frozen=True) class User(CallbackData): __callback_id__ = "x" id: int name: str is_admin: bool...
ValueError)
pytest.raises
variable
tests/test_callback_data.py
test_data
85
null
david-lev/pywa
import datetime import importlib import json import pathlib import pytest from pywa import _helpers as helpers from pywa import types from pywa.types import flows from pywa.types.templates import * # noqa: F403 def _resolve_example_handles(template: Template): not_uploaded = helpers._filter_not_uploaded_comps(t...
ValueError, match=r"Missing parameter for button #0 \(QuickReplyButton\)")
pytest.raises
func_call
tests/test_templates.py
test_validate_template_params
750
null
david-lev/pywa
import dataclasses import datetime import io import json import pathlib from unittest import mock import pytest from pywa import WhatsApp, filters, types, utils from pywa import _helpers as helpers from pywa._helpers import MediaSource from pywa.types import Contact from pywa.types.media import Media PHONE_ID = "123...
PHONE_ID
assert
variable
tests/test_client.py
test_resolve_phone_id_param
389
null
david-lev/pywa
import datetime import importlib import json import pathlib import pytest from pywa import _helpers as helpers from pywa import types from pywa.types import flows from pywa.types.templates import * # noqa: F403 def _resolve_example_handles(template: Template): not_uploaded = helpers._filter_not_uploaded_comps(t...
ParamFormat.NAMED
assert
complex_expr
tests/test_templates.py
test_template_text_examples_named
129
null
david-lev/pywa
import datetime from unittest.mock import MagicMock, call import pytest from pywa import WhatsApp, types from pywa.types import Result from pywa.types.flows import FlowDetails from pywa.types.sent_update import ( InitiatedCall, SentMessage, SentTemplate, SentTemplateStatus, ) wa = WhatsApp(phone_id="...
[]
assert
collection
tests/test_types.py
test_result_empty
376
null
david-lev/pywa
import datetime import importlib import json import pathlib import pytest from pywa import _helpers as helpers from pywa import types from pywa.types import flows from pywa.types.templates import * # noqa: F403 def _resolve_example_handles(template: Template): not_uploaded = helpers._filter_not_uploaded_comps(t...
"Hi David2, this is a text template number 1"
assert
string_literal
tests/test_templates.py
test_template_text_examples_positionals
75
null
david-lev/pywa
import dataclasses import datetime import importlib import json import pathlib from typing import Callable import pytest from pywa import WhatsApp, filters, handlers, utils from pywa.handlers import FlowCompletionHandler from pywa.types.flows import ( ComponentRef, DataSource, FlowJSON, FlowPreview, ...
"${form.test}"
assert
string_literal
tests/test_flows.py
test_component_ref
68
null
david-lev/pywa
import datetime from unittest.mock import MagicMock, call import pytest from pywa import WhatsApp, types from pywa.types import Result from pywa.types.flows import FlowDetails from pywa.types.sent_update import ( InitiatedCall, SentMessage, SentTemplate, SentTemplateStatus, ) wa = WhatsApp(phone_id="...
sm.to_user.wa_id
assert
complex_expr
tests/test_types.py
test_sent_message
267
null
david-lev/pywa
import datetime from unittest.mock import MagicMock, call import pytest from pywa import WhatsApp, types from pywa.types import Result from pywa.types.flows import FlowDetails from pywa.types.sent_update import ( InitiatedCall, SentMessage, SentTemplate, SentTemplateStatus, ) wa = WhatsApp(phone_id="...
False
assert
bool_literal
tests/test_types.py
test_result_empty
378
null
david-lev/pywa
import dataclasses from typing import Optional import pytest from pywa.types import CallbackData def test_data_sep(): """Test the data separator override.""" @dataclasses.dataclass(slots=True, frozen=True) class User(CallbackData): __callback_id__ = "x" __callback_data_sep__ = "*" ...
"x*3456*yyy*"
assert
string_literal
tests/test_callback_data.py
test_data_sep
107
null
david-lev/pywa
import datetime import functools from types import ModuleType import pytest from pywa import WhatsApp, filters, handlers, types from pywa.handlers import FlowRequestHandler, _flow_request_handler_attr from pywa.types import Message from pywa_async import WhatsApp as WhatsAppAsync FAKE_WA = WhatsApp(phone_id="1234567...
ValueError)
pytest.raises
variable
tests/test_handlers.py
test_remove_handlers
159
null
david-lev/pywa
import inspect import pytest from pywa import WhatsApp as WhatsAppSync from pywa.api import GraphAPI as GraphAPISync from pywa.handlers import _HandlerDecorators from pywa.listeners import _Listeners as ListenersSync from pywa.server import Server as ServerSync from pywa.types import ( CallbackButton as CallbackB...
async_doc
assert
variable
tests/test_async.py
_check_docs
461
null
david-lev/pywa
import inspect import pytest from pywa import WhatsApp as WhatsAppSync from pywa.api import GraphAPI as GraphAPISync from pywa.handlers import _HandlerDecorators from pywa.listeners import _Listeners as ListenersSync from pywa.server import Server as ServerSync from pywa.types import ( CallbackButton as CallbackB...
async_sig.return_annotation
assert
complex_expr
tests/test_async.py
test_same_return_annotation
415
null
david-lev/pywa
import dataclasses import datetime import importlib import json import pathlib from typing import Callable import pytest from pywa import WhatsApp, filters, handlers, utils from pywa.handlers import FlowCompletionHandler from pywa.types.flows import ( ComponentRef, DataSource, FlowJSON, FlowPreview, ...
on_completion
assert
variable
tests/test_flows.py
test_flow_callback_wrapper_on_completion
709
null
david-lev/pywa
import datetime import importlib import json import pathlib import pytest from pywa import _helpers as helpers from pywa import types from pywa.types import flows from pywa.types.templates import * # noqa: F403 def _resolve_example_handles(template: Template): not_uploaded = helpers._filter_not_uploaded_comps(t...
"Hi {{1}}, this is a text template number {{2}}"
assert
string_literal
tests/test_templates.py
test_template_text_examples_positionals
72
null
david-lev/pywa
import inspect import pytest from pywa import WhatsApp as WhatsAppSync from pywa.api import GraphAPI as GraphAPISync from pywa.handlers import _HandlerDecorators from pywa.listeners import _Listeners as ListenersSync from pywa.server import Server as ServerSync from pywa.types import ( CallbackButton as CallbackB...
async_method
assert
variable
tests/test_async.py
test_all_methods_are_overwritten_in_async
332
null
david-lev/pywa
import datetime from unittest.mock import MagicMock, call import pytest from pywa import WhatsApp, types from pywa.types import Result from pywa.types.flows import FlowDetails from pywa.types.sent_update import ( InitiatedCall, SentMessage, SentTemplate, SentTemplateStatus, ) wa = WhatsApp(phone_id="...
wa.phone_id
assert
complex_expr
tests/test_types.py
test_sent_message
266
null
david-lev/pywa
import datetime from unittest.mock import MagicMock, call import pytest from pywa import WhatsApp, types from pywa.types import Result from pywa.types.flows import FlowDetails from pywa.types.sent_update import ( InitiatedCall, SentMessage, SentTemplate, SentTemplateStatus, ) wa = WhatsApp(phone_id="...
"abc"
assert
string_literal
tests/test_types.py
test_result_properties
368
null
david-lev/pywa
import dataclasses import datetime import io import json import pathlib from unittest import mock import pytest from pywa import WhatsApp, filters, types, utils from pywa import _helpers as helpers from pywa._helpers import MediaSource from pywa.types import Contact from pywa.types.media import Media PHONE_ID = "123...
TOKEN
assert
variable
tests/test_client.py
test_token
565
null
david-lev/pywa
import dataclasses import datetime import io import json import pathlib from unittest import mock import pytest from pywa import WhatsApp, filters, types, utils from pywa import _helpers as helpers from pywa._helpers import MediaSource from pywa.types import Contact from pywa.types.media import Media PHONE_ID = "123...
None
assert
none_literal
tests/test_client.py
test_resolve_media_param
508
null
david-lev/pywa
import dataclasses import datetime import importlib import json import pathlib from typing import Callable import pytest from pywa import WhatsApp, filters, handlers, utils from pywa.handlers import FlowCompletionHandler from pywa.types.flows import ( ComponentRef, DataSource, FlowJSON, FlowPreview, ...
{"type": "number"}
assert
collection
tests/test_flows.py
test_encoder_py_to_json_types
454
null
jtesta/ssh-audit
import pytest from ssh_audit.ssh2_kexdb import SSH2_KexDB class Test_SSH2_KexDB: def init(self): self.db = SSH2_KexDB.get_db() self.pq_warning = SSH2_KexDB.WARN_NOT_PQ_SAFE def test_ssh2_kexdb(self): '''Ensures that the SSH2_KexDB.ALGORITHMS dictionary is in the right format.''' ...
len(added_entry)
assert
func_call
test/test_ssh2_kexdb.py
test_ssh2_kexdb
Test_SSH2_KexDB
36
null
jtesta/ssh-audit
import pytest from ssh_audit.algorithm import Algorithm from ssh_audit.timeframe import Timeframe class TestAlgorithm: def init(self, ssh_audit): self.algorithm = Algorithm self.timeframe = Timeframe def _tf(self, v, s=None): return self.timeframe().update(v, s) def test_get_ssh...
('Dropbear SSH', '2016.74', False)
assert
collection
test/test_algorithm.py
test_get_ssh_version
TestAlgorithm
23
null
jtesta/ssh-audit
import pytest from ssh_audit.outputbuffer import OutputBuffer from ssh_audit.ssh_socket import SSH_Socket class TestSocket: def init(self, ssh_audit): self.OutputBuffer = OutputBuffer self.ssh_socket = SSH_Socket def test_not_connected_socket(self, virtual_socket): sock = self.ssh_so...
-1
assert
numeric_literal
test/test_socket.py
test_not_connected_socket
TestSocket
35
null
jtesta/ssh-audit
import os import pytest from ssh_audit.outputbuffer import OutputBuffer from ssh_audit.ssh2_kex import SSH2_Kex from ssh_audit.ssh2_kexparty import SSH2_KexParty def kex(ssh_audit): kex_algs, key_algs = [], [] enc, mac, compression, languages = [], [], ['none'], [] cli = SSH2_KexParty(enc, mac, compressio...
9 * 2
assert
complex_expr
test/test_build_struct.py
test_prevent_runtime_error_regression
41
null
jtesta/ssh-audit
import pytest class TestOutputBuffer: def init(self, ssh_audit): self.OutputBuffer = ssh_audit.OutputBuffer def test_outputbuffer_level_property(self): out = self.OutputBuffer() out.level = 'info' assert out.level == 'info' out.level = 'good' assert out.level =...
'fail'
assert
string_literal
test/test_outputbuffer.py
test_outputbuffer_level_property
TestOutputBuffer
113
null
jtesta/ssh-audit
import hashlib import pytest from datetime import date from ssh_audit.builtin_policies import BUILTIN_POLICIES from ssh_audit.outputbuffer import OutputBuffer from ssh_audit.policy import Policy from ssh_audit.ssh2_kex import SSH2_Kex from ssh_audit.writebuf import WriteBuf class TestPolicy: def init(self, ssh_a...
2
assert
numeric_literal
test/test_policy.py
test_policy_evaluate_failing_7
TestPolicy
445
null
jtesta/ssh-audit
import pytest from ssh_audit.algorithm import Algorithm from ssh_audit.timeframe import Timeframe class TestAlgorithm: def init(self, ssh_audit): self.algorithm = Algorithm self.timeframe = Timeframe def _tf(self, v, s=None): return self.timeframe().update(v, s) def test_get_sin...
'available since OpenSSH 7.5'
assert
string_literal
test/test_algorithm.py
test_get_since_text
TestAlgorithm
31
null
jtesta/ssh-audit
import os import struct import pytest from ssh_audit.auditconf import AuditConf from ssh_audit.outputbuffer import OutputBuffer from ssh_audit.protocol import Protocol from ssh_audit.readbuf import ReadBuf from ssh_audit.ssh2_kex import SSH2_Kex from ssh_audit.ssh2_kexparty import SSH2_KexParty from ssh_audit.ssh_audi...
0
assert
numeric_literal
test/test_ssh2.py
test_kex_read
TestSSH2
99
null
jtesta/ssh-audit
import socket import pytest class TestResolve: def init(self, ssh_audit): self.AuditConf = ssh_audit.AuditConf self.audit = ssh_audit.audit self.OutputBuffer = ssh_audit.OutputBuffer self.ssh_socket = ssh_audit.SSH_Socket def _conf(self): conf = self.AuditConf('localho...
(socket.AF_INET6, ('::1', 22))
assert
collection
test/test_resolve.py
test_resolve_ipv6
TestResolve
55
null
jtesta/ssh-audit
import os import struct import pytest from ssh_audit.auditconf import AuditConf from ssh_audit.outputbuffer import OutputBuffer from ssh_audit.protocol import Protocol from ssh_audit.readbuf import ReadBuf from ssh_audit.ssh2_kex import SSH2_Kex from ssh_audit.ssh2_kexparty import SSH2_KexParty from ssh_audit.ssh_audi...
-1
assert
numeric_literal
test/test_ssh2.py
test_ssh2_gss_kex
TestSSH2
202
null
jtesta/ssh-audit
import socket import pytest class TestResolve: def init(self, ssh_audit): self.AuditConf = ssh_audit.AuditConf self.audit = ssh_audit.audit self.OutputBuffer = ssh_audit.OutputBuffer self.ssh_socket = ssh_audit.SSH_Socket def _conf(self): conf = self.AuditConf('localho...
socket.gaierror)
pytest.raises
complex_expr
test/test_resolve.py
test_resolve_error
TestResolve
26
null
jtesta/ssh-audit
import pytest class TestOutputBuffer: def init(self, ssh_audit): self.OutputBuffer = ssh_audit.OutputBuffer def test_outputbuffer_defaults(self): obuf = self.OutputBuffer() # default: on assert obuf.batch is False assert obuf.use_colors is True assert obuf.lev...
'info'
assert
string_literal
test/test_outputbuffer.py
test_outputbuffer_defaults
TestOutputBuffer
22
null
jtesta/ssh-audit
import pytest from ssh_audit.ssh2_kexdb import SSH2_KexDB class Test_SSH2_KexDB: def init(self): self.db = SSH2_KexDB.get_db() self.pq_warning = SSH2_KexDB.WARN_NOT_PQ_SAFE def test_ssh2_kexdb(self): '''Ensures that the SSH2_KexDB.ALGORITHMS dictionary is in the right format.''' ...
['enc', 'kex', 'key', 'mac']
assert
collection
test/test_ssh2_kexdb.py
test_ssh2_kexdb
Test_SSH2_KexDB
20
null
jtesta/ssh-audit
import pytest from ssh_audit.banner import Banner class TestBanner: def init(self, ssh_audit): self.banner = Banner def test_banners_with_multiple_protocols(self): b = lambda x: self.banner.parse(x) # noqa assert str(b('SSH-1.99-SSH-1.99-OpenSSH_3.6.1p2')) == 'SSH-1.99-OpenSSH_3.6.1...
'SSH-1.99-dropbear_0.5'
assert
string_literal
test/test_banner.py
test_banners_with_multiple_protocols
TestBanner
67
null
jtesta/ssh-audit
import pytest from ssh_audit.banner import Banner from ssh_audit.software import Software class TestVersionCompare: def init(self, ssh_audit): self.software = Software self.banner = Banner def get_dropbear_software(self, v): b = self.banner.parse('SSH-2.0-dropbear_{}'.format(v)) ...
1
assert
numeric_literal
test/test_version_compare.py
test_dropbear_compare_version_pre_years
TestVersionCompare
28
null
jtesta/ssh-audit
import hashlib import pytest from datetime import date from ssh_audit.builtin_policies import BUILTIN_POLICIES from ssh_audit.outputbuffer import OutputBuffer from ssh_audit.policy import Policy from ssh_audit.ssh2_kex import SSH2_Kex from ssh_audit.writebuf import WriteBuf class TestPolicy: def init(self, ssh_a...
-1
assert
numeric_literal
test/test_policy.py
test_policy_evaluate_failing_1
TestPolicy
338
null
jtesta/ssh-audit
import socket import errno import pytest from ssh_audit.outputbuffer import OutputBuffer class TestErrors: def init(self, ssh_audit): self.AuditConf = ssh_audit.AuditConf self.OutputBuffer = ssh_audit.OutputBuffer self.audit = ssh_audit.audit def _conf(self): conf = self.Audi...
lines[-1]
assert
complex_expr
test/test_errors.py
test_connection_unresolved
TestErrors
50
null
jtesta/ssh-audit
import hashlib import pytest from datetime import date from ssh_audit.builtin_policies import BUILTIN_POLICIES from ssh_audit.outputbuffer import OutputBuffer from ssh_audit.policy import Policy from ssh_audit.ssh2_kex import SSH2_Kex from ssh_audit.writebuf import WriteBuf class TestPolicy: def init(self, ssh_a...
1
assert
numeric_literal
test/test_policy.py
test_policy_evaluate_failing_1
TestPolicy
337
null
jtesta/ssh-audit
import pytest from ssh_audit.banner import Banner class TestBanner: def init(self, ssh_audit): self.banner = Banner def test_banners_without_software(self): b = lambda x: self.banner.parse(x) # noqa assert b('SSH-2.0').protocol == (2, 0) assert b('SSH-2.0').software is None ...
''
assert
string_literal
test/test_banner.py
test_banners_without_software
TestBanner
53
null
jtesta/ssh-audit
import pytest from ssh_audit.ssh2_kexdb import SSH2_KexDB from ssh_audit.dheat import DHEat class TestDHEat: def init(self): self.SSH2_KexDB = SSH2_KexDB self.DHEat = DHEat def test_kex_definition_completeness(self): alg_db = self.SSH2_KexDB.get_db() kex_db = alg_db['kex'] ...
self.DHEat.alg_modulus_sizes
assert
complex_expr
test/test_dheater.py
test_kex_definition_completeness
TestDHEat
29
null
jtesta/ssh-audit
import os import struct import pytest from ssh_audit.auditconf import AuditConf from ssh_audit.outputbuffer import OutputBuffer from ssh_audit.protocol import Protocol from ssh_audit.readbuf import ReadBuf from ssh_audit.ssh2_kex import SSH2_Kex from ssh_audit.ssh2_kexparty import SSH2_KexParty from ssh_audit.ssh_audi...
lines[-1]
assert
complex_expr
test/test_ssh2.py
test_ssh2_server_invalid_first_packet
TestSSH2
183
null
jtesta/ssh-audit
import pytest from ssh_audit.ssh_audit import process_commandline class TestAuditConf: def init(self, ssh_audit): self.AuditConf = ssh_audit.AuditConf self.OutputBuffer = ssh_audit.OutputBuffer() self.process_commandline = process_commandline @staticmethod def _test_conf(conf, **k...
options['ipv4']
assert
complex_expr
test/test_auditconf.py
_test_conf
TestAuditConf
33
null
jtesta/ssh-audit
import pytest from ssh_audit.banner import Banner from ssh_audit.software import Software class TestSoftware: def init(self, ssh_audit): self.software = Software self.banner = Banner def test_openssh_software(self): # pylint: disable=too-many-statements ps = lambda x: self.so...
'p1'
assert
string_literal
test/test_software.py
test_openssh_software
TestSoftware
40
null
jtesta/ssh-audit
import socket import errno import pytest from ssh_audit.outputbuffer import OutputBuffer class TestErrors: def init(self, ssh_audit): self.AuditConf = ssh_audit.AuditConf self.OutputBuffer = ssh_audit.OutputBuffer self.audit = ssh_audit.audit def _conf(self): conf = self.Audi...
0
assert
numeric_literal
test/test_errors.py
_audit
TestErrors
34
null
jtesta/ssh-audit
import socket import errno import pytest from ssh_audit.outputbuffer import OutputBuffer class TestErrors: def init(self, ssh_audit): self.AuditConf = ssh_audit.AuditConf self.OutputBuffer = ssh_audit.OutputBuffer self.audit = ssh_audit.audit def _conf(self): conf = self.Audi...
3
assert
numeric_literal
test/test_errors.py
test_connection_closed_after_header
TestErrors
116
null
jtesta/ssh-audit
import pytest from ssh_audit.ssh_audit import process_commandline class TestAuditConf: def init(self, ssh_audit): self.AuditConf = ssh_audit.AuditConf self.OutputBuffer = ssh_audit.OutputBuffer() self.process_commandline = process_commandline @staticmethod def _test_conf(conf, **k...
options['ipv6']
assert
complex_expr
test/test_auditconf.py
_test_conf
TestAuditConf
34
null
jtesta/ssh-audit
import pytest class TestUtils: def init(self, ssh_audit): self.utils = ssh_audit.Utils def test_parse_int(self): assert self.utils.parse_int(123) == 123 assert self.utils.parse_int('123') == 123 assert self.utils.parse_int(-123) ==
-123
assert
numeric_literal
test/test_utils.py
test_parse_int
TestUtils
61
null
jtesta/ssh-audit
import pytest from ssh_audit.ssh_audit import process_commandline class TestAuditConf: def init(self, ssh_audit): self.AuditConf = ssh_audit.AuditConf self.OutputBuffer = ssh_audit.OutputBuffer() self.process_commandline = process_commandline def _test_conf(conf, **kwargs): op...
ValueError)
pytest.raises
variable
test/test_auditconf.py
test_audit_conf_port
TestAuditConf
56
null
jtesta/ssh-audit
import pytest class TestUtils: def init(self, ssh_audit): self.utils = ssh_audit.Utils def test_parse_int(self): assert self.utils.parse_int(123) == 123 assert self.utils.parse_int('123') == 123 assert self.utils.parse_int(-123) == -123 assert self.utils.parse_int('-12...
0
assert
numeric_literal
test/test_utils.py
test_parse_int
TestUtils
63
null
jtesta/ssh-audit
import socket import errno import pytest from ssh_audit.outputbuffer import OutputBuffer class TestErrors: def init(self, ssh_audit): self.AuditConf = ssh_audit.AuditConf self.OutputBuffer = ssh_audit.OutputBuffer self.audit = ssh_audit.audit def _conf(self): conf = self.Audi...
4
assert
numeric_literal
test/test_errors.py
test_protocol_mismatch_by_conf
TestErrors
170
null
jtesta/ssh-audit
import pytest class TestUtils: def init(self, ssh_audit): self.utils = ssh_audit.Utils def test_ctoi(self): assert self.utils.ctoi(123) == 123 assert self.utils.ctoi('ABC') ==
65
assert
numeric_literal
test/test_utils.py
test_ctoi
TestUtils
56
null
jtesta/ssh-audit
import pytest from ssh_audit.hardening_guides import Hardening_Guides class TestHardeningGuides: def init(self, ssh_audit): self.OutputBuffer = ssh_audit.OutputBuffer() def test_hardening_guides_consistency(self): '''Ensure that the HARDENING_GUIDES struct is consistent.''' # Requir...
2
assert
numeric_literal
test/test_hardeningguides.py
test_hardening_guides_consistency
TestHardeningGuides
61
null
jtesta/ssh-audit
import pytest class TestOutputBuffer: def init(self, ssh_audit): self.OutputBuffer = ssh_audit.OutputBuffer def test_outputbuffer_levels(self): out = self.OutputBuffer() assert out.get_level('info') == 0 assert out.get_level('good') == 0 assert out.get_level('warn') ==...
2
assert
numeric_literal
test/test_outputbuffer.py
test_outputbuffer_levels
TestOutputBuffer
101
null