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 |
|---|---|---|---|---|---|---|---|---|---|
liiight/notifiers | import json
import pytest
from retry import retry
from notifiers.exceptions import BadArguments, NotificationError
provider = "telegram"
class TestTelegram:
@pytest.mark.parametrize(
("data", "message"),
[
({}, "message"),
({"message": "foo"}, "chat_id"),
({"... | e.value.message | assert | complex_expr | tests/providers/test_telegram.py | test_missing_required | TestTelegram | 33 | null |
liiight/notifiers | import os
import pytest
from notifiers.exceptions import BadArguments
provider = "pushbullet"
class TestPushbullet:
@pytest.mark.parametrize(("data", "message"), [({}, "message"), ({"message": "foo"}, "token")])
def test_missing_required(self, data, message, provider):
data["env_prefix"] = "test"
... | e.value.message | assert | complex_expr | tests/providers/test_pushbullet.py | test_missing_required | TestPushbullet | 24 | null |
liiight/notifiers | import pytest
from notifiers.exceptions import BadArguments, NotificationError, ResourceError
provider = "gitter"
class TestGitterResources:
resource = "rooms"
def test_gitter_rooms_negative_2(self, resource):
with pytest.raises( | ResourceError) | pytest.raises | variable | tests/providers/test_gitter.py | test_gitter_rooms_negative_2 | TestGitterResources | 85 | null |
liiight/notifiers | import json
import pytest
from retry import retry
from notifiers.exceptions import BadArguments, NotificationError
provider = "telegram"
class TestTelegram:
def test_bad_token(self, provider):
data = {"token": "foo", "chat_id": 1, "message": "foo"}
with pytest.raises( | NotificationError) | pytest.raises | variable | tests/providers/test_telegram.py | test_bad_token | TestTelegram | 37 | null |
liiight/notifiers | import datetime
import time
from email import utils
import pytest
from notifiers.core import FAILURE_STATUS
from notifiers.exceptions import BadArguments
provider = "mailgun"
class TestMailgun:
def test_mailgun_error_response(self, provider):
data = {
"api_key": "FOO",
"message"... | rsp.errors | assert | complex_expr | tests/providers/test_mailgun.py | test_mailgun_error_response | TestMailgun | 85 | null |
liiight/notifiers | import pytest
from notifiers.exceptions import BadArguments, NotificationError, ResourceError
provider = "join"
class TestJoinDevices:
resource = "devices"
def test_join_devices_negative_online(self, resource):
with pytest.raises( | ResourceError) | pytest.raises | variable | tests/providers/test_join.py | test_join_devices_negative_online | TestJoinDevices | 58 | null |
liiight/notifiers | import pytest
from notifiers.exceptions import BadArguments, NotificationError
provider = "pushover"
class TestPushoverCLI:
@pytest.mark.online
def test_pushover_sounds_positive(self, cli_runner):
cmd = ["pushover", "sounds"]
result = cli_runner(cmd)
assert not result.exit_code
... | result.output | assert | complex_expr | tests/providers/test_pushover.py | test_pushover_sounds_positive | TestPushoverCLI | 147 | null |
liiight/notifiers | import pytest
from notifiers.exceptions import BadArguments, NotificationError, ResourceError
provider = "gitter"
class TestGitterResources:
resource = "rooms"
def test_gitter_rooms_negative_2(self, resource):
with pytest.raises(ResourceError) as e:
resource(token="foo")
assert e... | 401 | assert | numeric_literal | tests/providers/test_gitter.py | test_gitter_rooms_negative_2 | TestGitterResources | 88 | null |
liiight/notifiers | import datetime
import logging
import os
from time import sleep
import pytest
import requests
from notifiers.core import FAILURE_STATUS
from notifiers.exceptions import BadArguments, ResourceError
provider = "statuspage"
log = logging.getLogger("statuspage")
def close_all_open_incidents():
api_key = os.getenv(... | BadArguments) | pytest.raises | variable | tests/providers/test_statuspage.py | test_statuspage_components_negative | TestStatuspageComponents | 161 | null |
liiight/notifiers | import pytest
from notifiers.exceptions import BadArguments
provider = "simplepush"
class TestSimplePush:
@pytest.mark.parametrize(("data", "message"), [({}, "key"), ({"key": "foo"}, "message")])
def test_simplepush_missing_required(self, data, message, provider):
data["env_prefix"] = "test"
... | BadArguments) | pytest.raises | variable | tests/providers/test_simplepush.py | test_simplepush_missing_required | TestSimplePush | 24 | null |
liiight/notifiers | import datetime
import pytest
from notifiers.exceptions import BadArguments, NotifierException
provider = "zulip"
class TestZulip:
def test_metadata(self, provider):
assert provider.metadata == | { "base_url": "https://{domain}.zulipchat.com", "site_url": "https://zulipchat.com/api/", "name": "zulip", } | assert | collection | tests/providers/test_zulip.py | test_metadata | TestZulip | 12 | null |
liiight/notifiers | import pytest
from notifiers.exceptions import BadArguments, NotificationError
provider = "gmail"
class TestGmail:
def test_gmail_negative(self, provider):
data = {
"username": "foo",
"password": "foo",
"to": "foo@foo.com",
"message": "bar",
}
... | e.value.errors[0] | assert | complex_expr | tests/providers/test_gmail.py | test_gmail_negative | TestGmail | 67 | null |
liiight/notifiers | import pytest
from notifiers.utils.helpers import (
dict_from_environs,
merge_dicts,
snake_to_camel_case,
text_to_bool,
valid_file,
)
from notifiers.utils.requests import file_list_for_request
class TestHelpers:
@pytest.mark.parametrize(
("text", "result"),
[
("y", ... | result | assert | variable | tests/test_utils.py | test_text_to_bool | TestHelpers | 30 | null |
liiight/notifiers | import pytest
provider = "victorops"
class TestVicrotops:
@pytest.mark.skip("Skipping until obtaining a permanent key")
@pytest.mark.online
def test_all_options(self, provider):
data = {
"message_type": "info",
"entity_id": "BA tesing",
"entity_display_name": "... | "Success" | assert | string_literal | tests/providers/test_victorops.py | test_all_options | TestVicrotops | 32 | null |
liiight/notifiers | import sys
import typing
import pytest
import notifiers
from notifiers import notify
from notifiers.core import SUCCESS_STATUS, Provider, Response
from notifiers.exceptions import (
BadArguments,
NoSuchNotifierError,
NotificationError,
SchemaError,
)
class TestCore:
valid_data: typing.ClassVar =... | SchemaError) | pytest.raises | variable | tests/test_core.py | test_bad_schema | TestCore | 72 | null |
liiight/notifiers | import pytest
from notifiers.exceptions import BadArguments, NotificationError, ResourceError
provider = "gitter"
class TestGitterResources:
resource = "rooms"
def test_gitter_rooms_attribs(self, resource):
assert resource.schema == {
"type": "object",
"properties": {
... | provider | assert | variable | tests/providers/test_gitter.py | test_gitter_rooms_attribs | TestGitterResources | 77 | null |
liiight/notifiers | import pytest
from notifiers.utils.helpers import (
dict_from_environs,
merge_dicts,
snake_to_camel_case,
text_to_bool,
valid_file,
)
from notifiers.utils.requests import file_list_for_request
class TestHelpers:
def test_file_list_for_request(self, tmpdir):
file_1 = tmpdir.join("file_... | 2 | assert | numeric_literal | tests/test_utils.py | test_file_list_for_request | TestHelpers | 84 | null |
liiight/notifiers | import sys
import typing
import pytest
import notifiers
from notifiers import notify
from notifiers.core import SUCCESS_STATUS, Provider, Response
from notifiers.exceptions import (
BadArguments,
NoSuchNotifierError,
NotificationError,
SchemaError,
)
class TestCore:
valid_data: typing.ClassVar =... | "mock_resource" | assert | string_literal | tests/test_core.py | test_resources | TestCore | 159 | null |
liiight/notifiers | import datetime
import logging
import os
from time import sleep
import pytest
import requests
from notifiers.core import FAILURE_STATUS
from notifiers.exceptions import BadArguments, ResourceError
provider = "statuspage"
log = logging.getLogger("statuspage")
def close_all_open_incidents():
api_key = os.getenv(... | { "base_url": "https://api.statuspage.io/v1//pages/{page_id}/", "name": "statuspage", "site_url": "https://statuspage.io", } | assert | collection | tests/providers/test_statuspage.py | test_metadata | TestStatusPage | 37 | null |
liiight/notifiers | from email.message import EmailMessage
import pytest
from notifiers.exceptions import BadArguments, NotificationError
provider = "email"
class TestSMTP:
@pytest.mark.parametrize(("data", "message"), [({}, "message"), ({"message": "foo"}, "to")])
def test_smtp_missing_required(self, data, message, provider)... | BadArguments) | pytest.raises | variable | tests/providers/test_smtp.py | test_smtp_missing_required | TestSMTP | 23 | null |
liiight/notifiers | import sys
import typing
import pytest
import notifiers
from notifiers import notify
from notifiers.core import SUCCESS_STATUS, Provider, Response
from notifiers.exceptions import (
BadArguments,
NoSuchNotifierError,
NotificationError,
SchemaError,
)
class TestCore:
valid_data: typing.ClassVar =... | "bar" | assert | string_literal | tests/test_core.py | test_provided_data_takes_precedence_over_environ | TestCore | 147 | null |
liiight/notifiers | import datetime
import pytest
from notifiers.exceptions import BadArguments
provider = "pagerduty"
class TestPagerDuty:
@pytest.mark.online
def test_pagerduty_sanity(self, provider, test_message):
data = {
"message": test_message,
"event_action": "trigger",
"sour... | {"status": "success", "message": "Event processed"} | assert | collection | tests/providers/test_pagerduty.py | test_pagerduty_sanity | TestPagerDuty | 56 | null |
liiight/notifiers | import pytest
from notifiers.exceptions import BadArguments, NotificationError, ResourceError
provider = "join"
class TestJoin:
def test_negative(self, provider):
data = {"message": "foo", "apikey": "bar"}
rsp = provider.notify(**data)
with pytest.raises(NotificationError) as e:
... | ["User Not Authenticated"] | assert | collection | tests/providers/test_join.py | test_negative | TestJoin | 39 | null |
liiight/notifiers | import pytest
from notifiers.exceptions import BadArguments, NotificationError, ResourceError
provider = "gitter"
class TestGitterResources:
resource = "rooms"
def test_gitter_rooms_attribs(self, resource):
assert resource.schema == | { "type": "object", "properties": { "token": {"type": "string", "title": "access token"}, "filter": {"type": "string", "title": "Filter results"}, }, "required": ["token"], "additionalProperties": False, } | assert | collection | tests/providers/test_gitter.py | test_gitter_rooms_attribs | TestGitterResources | 68 | null |
liiight/notifiers | import sys
import typing
import pytest
import notifiers
from notifiers import notify
from notifiers.core import SUCCESS_STATUS, Provider, Response
from notifiers.exceptions import (
BadArguments,
NoSuchNotifierError,
NotificationError,
SchemaError,
)
class TestCore:
valid_data: typing.ClassVar =... | TypeError) | pytest.raises | variable | tests/test_core.py | test_bad_integration | TestCore | 123 | null |
liiight/notifiers | import pytest
from notifiers.exceptions import BadArguments
provider = "simplepush"
class TestSimplePush:
def test_simplepush_metadata(self, provider):
assert provider.metadata == | { "base_url": "https://api.simplepush.io/send", "site_url": "https://simplepush.io/", "name": "simplepush", } | assert | collection | tests/providers/test_simplepush.py | test_simplepush_metadata | TestSimplePush | 15 | null |
liiight/notifiers | import pytest
from notifiers.exceptions import BadArguments, NotificationError
provider = "pushover"
class TestPushoverSoundsResource:
resource = "sounds"
def test_pushover_sounds_attribs(self, resource):
assert resource.schema == {
"type": "object",
"properties": {"token": {... | provider | assert | variable | tests/providers/test_pushover.py | test_pushover_sounds_attribs | TestPushoverSoundsResource | 102 | null |
liiight/notifiers | import os
import pytest
from notifiers.exceptions import BadArguments
provider = "pushbullet"
class TestPushbullet:
def test_metadata(self, provider):
assert provider.metadata == | { "base_url": "https://api.pushbullet.com/v2/pushes", "name": "pushbullet", "site_url": "https://www.pushbullet.com", } | assert | collection | tests/providers/test_pushbullet.py | test_metadata | TestPushbullet | 13 | null |
liiight/notifiers | from email.message import EmailMessage
import pytest
from notifiers.exceptions import BadArguments, NotificationError
provider = "email"
class TestSMTP:
def test_email_from_key(self, provider):
rsp = provider.notify(
to="foo@foo.co ",
from_="bla@foo.com",
message="fo... | "bla@foo.com" | assert | string_literal | tests/providers/test_smtp.py | test_email_from_key | TestSMTP | 54 | null |
liiight/notifiers | import pytest
provider = "victorops"
class TestVicrotops:
@pytest.mark.skip("Skipping until obtaining a permanent key")
@pytest.mark.online
def test_all_options(self, provider):
data = {
"message_type": "info",
"entity_id": "BA tesing",
"entity_display_name": "... | None | assert | none_literal | tests/providers/test_victorops.py | test_all_options | TestVicrotops | 33 | null |
liiight/notifiers | import sys
import typing
import pytest
import notifiers
from notifiers import notify
from notifiers.core import SUCCESS_STATUS, Provider, Response
from notifiers.exceptions import (
BadArguments,
NoSuchNotifierError,
NotificationError,
SchemaError,
)
class TestCore:
valid_data: typing.ClassVar =... | SUCCESS_STATUS | assert | variable | tests/test_core.py | test_environs | TestCore | 138 | null |
liiight/notifiers | import datetime
import pytest
from notifiers.exceptions import BadArguments
provider = "pagerduty"
class TestPagerDuty:
@pytest.mark.parametrize(
("data", "message"),
[
({}, "routing_key"),
({"routing_key": "foo"}, "event_action"),
({"routing_key": "foo", "ev... | e.value.message | assert | complex_expr | tests/providers/test_pagerduty.py | test_pagerduty_missing_required | TestPagerDuty | 43 | null |
liiight/notifiers | import logging
import pytest
from notifiers.exceptions import NoSuchNotifierError
log = logging.getLogger("test_logger")
class TestLogger:
def test_with_error(self, mock_provider, handler, capsys):
hdlr = handler(mock_provider.name, logging.INFO)
log.addHandler(hdlr)
log.info("test")
... | capsys.readouterr().err | assert | func_call | tests/test_logger.py | test_with_error | TestLogger | 16 | null |
liiight/notifiers | import sys
import typing
import pytest
import notifiers
from notifiers import notify
from notifiers.core import SUCCESS_STATUS, Provider, Response
from notifiers.exceptions import (
BadArguments,
NoSuchNotifierError,
NotificationError,
SchemaError,
)
class TestCore:
valid_data: typing.ClassVar =... | None | assert | none_literal | tests/test_core.py | test_sanity | TestCore | 53 | null |
liiight/notifiers | from email.message import EmailMessage
import pytest
from notifiers.exceptions import BadArguments, NotificationError
provider = "email"
class TestSMTP:
def test_attachment_mimetypes(self, provider, tmpdir):
dir_ = tmpdir.mkdir("sub")
file_1 = dir_.join("foo.txt")
file_1.write("foo")
... | "text/plain" | assert | string_literal | tests/providers/test_smtp.py | test_attachment_mimetypes | TestSMTP | 92 | null |
liiight/notifiers | import pytest
from notifiers.exceptions import BadArguments, NotificationError, ResourceError
provider = "join"
class TestJoin:
def test_negative(self, provider):
data = {"message": "foo", "apikey": "bar"}
rsp = provider.notify(**data)
with pytest.raises( | NotificationError) | pytest.raises | variable | tests/providers/test_join.py | test_negative | TestJoin | 36 | null |
liiight/notifiers | import datetime
import logging
import os
from time import sleep
import pytest
import requests
from notifiers.core import FAILURE_STATUS
from notifiers.exceptions import BadArguments, ResourceError
provider = "statuspage"
log = logging.getLogger("statuspage")
def close_all_open_incidents():
api_key = os.getenv(... | BadArguments, match=f"'{message}' is a required property") | pytest.raises | complex_expr | tests/providers/test_statuspage.py | test_missing_required | TestStatusPage | 53 | null |
liiight/notifiers | import re
import pytest
import notifiers
mock_name = "mock_provider"
class TestCLI:
def test_notify_sanity(self, cli_runner):
"""Test valid notification usage"""
cmd = f"{mock_name} notify --required bar foo".split()
result = cli_runner(cmd)
assert not result.exit_code, f"Exit c... | result.output | assert | complex_expr | tests/test_cli.py | test_notify_sanity | TestCLI | 26 | null |
liiight/notifiers | from email.message import EmailMessage
import pytest
from notifiers.exceptions import BadArguments, NotificationError
provider = "email"
class TestSMTP:
def test_smtp_metadata(self, provider):
assert provider.metadata == | { "base_url": None, "name": "email", "site_url": "https://en.wikipedia.org/wiki/Email", } | assert | collection | tests/providers/test_smtp.py | test_smtp_metadata | TestSMTP | 14 | null |
liiight/notifiers | import datetime
import time
from email import utils
import pytest
from notifiers.core import FAILURE_STATUS
from notifiers.exceptions import BadArguments
provider = "mailgun"
class TestMailgun:
def test_mailgun_metadata(self, provider):
assert provider.metadata == | { "base_url": "https://api.mailgun.net/v3/{domain}/messages", "name": "mailgun", "site_url": "https://documentation.mailgun.com/", } | assert | collection | tests/providers/test_mailgun.py | test_mailgun_metadata | TestMailgun | 16 | null |
liiight/notifiers | import pytest
from notifiers.exceptions import BadArguments, NotificationError, ResourceError
provider = "join"
class TestJoin:
@pytest.mark.parametrize(("data", "message"), [({}, "apikey"), ({"apikey": "foo"}, "message")])
def test_missing_required(self, data, message, provider):
data["env_prefix"]... | e.value.message | assert | complex_expr | tests/providers/test_join.py | test_missing_required | TestJoin | 21 | null |
liiight/notifiers | import pytest
from notifiers.core import FAILURE_STATUS
from notifiers.exceptions import BadArguments, NotificationError
provider = "popcornnotify"
class TestPopcornNotify:
def test_popcornnotify_error(self, provider):
data = {"message": "foo", "api_key": "foo", "recipients": "foo@foo.com"}
rsp ... | rsp.errors | assert | complex_expr | tests/providers/test_popcornnotify.py | test_popcornnotify_error | TestPopcornNotify | 42 | null |
liiight/notifiers | from email.message import EmailMessage
import pytest
from notifiers.exceptions import BadArguments, NotificationError
provider = "email"
class TestSMTP:
def test_smtp_no_host(self, provider):
data = {
"to": "foo@foo.com",
"message": "bar",
"host": "nohost",
... | NotificationError) | pytest.raises | variable | tests/providers/test_smtp.py | test_smtp_no_host | TestSMTP | 36 | null |
liiight/notifiers | import datetime
import pytest
from notifiers.exceptions import BadArguments, NotifierException
provider = "zulip"
class TestZulip:
def test_zulip_missing_subject(self, provider):
with pytest.raises( | NotifierException) | pytest.raises | variable | tests/providers/test_zulip.py | test_zulip_missing_subject | TestZulip | 80 | null |
liiight/notifiers | import json
import pytest
from retry import retry
from notifiers.exceptions import BadArguments, NotificationError
provider = "telegram"
class TestTelegramResources:
resource = "updates"
def test_telegram_updates_attribs(self, resource):
assert resource.schema == {
"additionalProperties... | {"required": ["token"]} | assert | collection | tests/providers/test_telegram.py | test_telegram_updates_attribs | TestTelegramResources | 76 | null |
liiight/notifiers | import sys
import typing
import pytest
import notifiers
from notifiers import notify
from notifiers.core import SUCCESS_STATUS, Provider, Response
from notifiers.exceptions import (
BadArguments,
NoSuchNotifierError,
NotificationError,
SchemaError,
)
class TestCore:
valid_data: typing.ClassVar =... | BadArguments) | pytest.raises | variable | tests/test_core.py | test_resources | TestCore | 173 | null |
liiight/notifiers | import pytest
from notifiers.exceptions import BadArguments, NotificationError
provider = "gmail"
class TestGmail:
def test_gmail_metadata(self, provider):
assert provider.metadata == | { "base_url": "smtp.gmail.com", "name": "gmail", "site_url": "https://www.google.com/gmail/about/", } | assert | collection | tests/providers/test_gmail.py | test_gmail_metadata | TestGmail | 12 | null |
liiight/notifiers | import pytest
from notifiers.exceptions import BadArguments, NotificationError, ResourceError
provider = "gitter"
class TestGitter:
@pytest.mark.skip(reason="Disabled account")
@pytest.mark.online
def test_bad_request(self, provider):
data = {"token": "foo", "room_id": "baz", "message": "bar"}
... | NotificationError) | pytest.raises | variable | tests/providers/test_gitter.py | test_bad_request | TestGitter | 35 | null |
liiight/notifiers | import json
import pytest
from retry import retry
from notifiers.exceptions import BadArguments, NotificationError
provider = "telegram"
class TestTelegram:
@pytest.mark.parametrize(
("data", "message"),
[
({}, "message"),
({"message": "foo"}, "chat_id"),
({"... | BadArguments) | pytest.raises | variable | tests/providers/test_telegram.py | test_missing_required | TestTelegram | 31 | null |
liiight/notifiers | import pytest
from notifiers.exceptions import BadArguments, NotificationError
provider = "icloud"
class TestiCloud:
def test_icloud_negative(self, provider):
data = {
"username": "foo",
"password": "foo",
"from": "bla@foo.com",
"to": "foo@foo.com",
... | NotificationError) | pytest.raises | variable | tests/providers/test_icloud.py | test_icloud_negative | TestiCloud | 66 | null |
liiight/notifiers | import re
import pytest
import notifiers
mock_name = "mock_provider"
class TestCLI:
def test_version_command(self, cli_runner):
result = cli_runner(["--version"])
assert not result.exit_code
version_re = re.search(r"(\d+\.\d+\.\d+)", result.output)
assert version_re
ass... | notifiers.__version__ | assert | complex_expr | tests/test_cli.py | test_version_command | TestCLI | 107 | null |
liiight/notifiers | import pytest
from notifiers.exceptions import BadArguments, NotificationError, ResourceError
provider = "join"
class TestJoin:
def test_metadata(self, provider):
assert provider.metadata == | { "base_url": "https://joinjoaomgcd.appspot.com/_ah/api/messaging/v1", "name": "join", "site_url": "https://joaoapps.com/join/api/", } | assert | collection | tests/providers/test_join.py | test_metadata | TestJoin | 10 | null |
liiight/notifiers | import pytest
from notifiers.exceptions import BadArguments, NotificationError
provider = "pushover"
class TestPushoverSoundsResource:
resource = "sounds"
def test_pushover_sounds_attribs(self, resource):
assert resource.schema == | { "type": "object", "properties": {"token": {"type": "string", "title": "your application's API token"}}, "required": ["token"], } | assert | collection | tests/providers/test_pushover.py | test_pushover_sounds_attribs | TestPushoverSoundsResource | 96 | null |
liiight/notifiers | import pytest
from notifiers.core import FAILURE_STATUS
from notifiers.exceptions import BadArguments, NotificationError
provider = "popcornnotify"
class TestPopcornNotify:
def test_popcornnotify_metadata(self, provider):
assert provider.metadata == | { "base_url": "https://popcornnotify.com/notify", "name": "popcornnotify", "site_url": "https://popcornnotify.com/", } | assert | collection | tests/providers/test_popcornnotify.py | test_popcornnotify_metadata | TestPopcornNotify | 11 | null |
liiight/notifiers | import datetime
import time
from email import utils
import pytest
from notifiers.core import FAILURE_STATUS
from notifiers.exceptions import BadArguments
provider = "mailgun"
class TestMailgun:
@pytest.mark.parametrize(
("data", "message"),
[
({}, "to"),
({"to": "foo"}, ... | BadArguments, match=f"'{message}' is a required property") | pytest.raises | complex_expr | tests/providers/test_mailgun.py | test_mailgun_missing_required | TestMailgun | 37 | null |
liiight/notifiers | import datetime
import pytest
from notifiers.exceptions import BadArguments, NotifierException
provider = "zulip"
class TestZulip:
def test_zulip_type_key(self, provider):
rsp = provider.notify(
email="foo@foo.com",
api_key="bar",
to="baz",
domain="bla",
... | "private" | assert | string_literal | tests/providers/test_zulip.py | test_zulip_type_key | TestZulip | 77 | null |
liiight/notifiers | import hypothesis.strategies as st
import pytest
from hypothesis import given
from jsonschema import ValidationError, validate
from notifiers.utils.schema.formats import format_checker
from notifiers.utils.schema.helpers import list_to_commas, one_or_more
class TestSchemaUtils:
@given(st.lists(st.text()))
de... | ",".join(input_data) | assert | string_literal | tests/test_json_schema.py | test_list_to_commas | TestSchemaUtils | 89 | null |
liiight/notifiers | import datetime
import pytest
from notifiers.exceptions import BadArguments
provider = "pagerduty"
class TestPagerDuty:
def test_pagerduty_metadata(self, provider):
assert provider.metadata == | { "base_url": "https://events.pagerduty.com/v2/enqueue", "name": "pagerduty", "site_url": "https://v2.developer.pagerduty.com/", } | assert | collection | tests/providers/test_pagerduty.py | test_pagerduty_metadata | TestPagerDuty | 12 | null |
liiight/notifiers | import pytest
from notifiers.exceptions import BadArguments, NotificationError
provider = "gmail"
class TestGmail:
def test_multiple_to(self, provider):
to = ["foo@foo.com", "bar@foo.com"]
rsp = provider.notify(to=to, message="foo", host="goo", username="ding", password="dong")
assert r... | ",".join(to) | assert | string_literal | tests/providers/test_gmail.py | test_multiple_to | TestGmail | 54 | null |
liiight/notifiers | import pytest
from notifiers.core import FAILURE_STATUS
from notifiers.exceptions import BadArguments, NotificationError
provider = "popcornnotify"
class TestPopcornNotify:
@pytest.mark.parametrize(
("data", "message"),
[
({}, "message"),
({"message": "foo"}, "api_key"),
... | BadArguments) | pytest.raises | variable | tests/providers/test_popcornnotify.py | test_popcornnotify_missing_required | TestPopcornNotify | 27 | null |
liiight/notifiers | import datetime
import time
from email import utils
import pytest
from notifiers.core import FAILURE_STATUS
from notifiers.exceptions import BadArguments
provider = "mailgun"
class TestMailgun:
def test_mailgun_error_response(self, provider):
data = {
"api_key": "FOO",
"message"... | FAILURE_STATUS | assert | variable | tests/providers/test_mailgun.py | test_mailgun_error_response | TestMailgun | 84 | null |
liiight/notifiers | import pytest
from notifiers.exceptions import BadArguments, NotificationError, ResourceError
provider = "gitter"
class TestGitter:
@pytest.mark.parametrize(
("data", "message"),
[
({}, "message"),
({"message": "foo"}, "token"),
({"message": "foo", "token": "b... | e.value.message | assert | complex_expr | tests/providers/test_gitter.py | test_missing_required | TestGitter | 29 | null |
liiight/notifiers | import pytest
from notifiers.core import FAILURE_STATUS
from notifiers.exceptions import BadArguments, NotificationError
provider = "popcornnotify"
class TestPopcornNotify:
@pytest.mark.parametrize(
("data", "message"),
[
({}, "message"),
({"message": "foo"}, "api_key"),
... | e.value.message | assert | complex_expr | tests/providers/test_popcornnotify.py | test_popcornnotify_missing_required | TestPopcornNotify | 29 | null |
liiight/notifiers | import logging
import pytest
from notifiers.exceptions import NoSuchNotifierError
log = logging.getLogger("test_logger")
class TestLogger:
def test_valid_logging(self, magic_mock_provider, handler):
hdlr = handler(magic_mock_provider.name, logging.INFO)
log.addHandler(hdlr)
assert repr... | "<NotificationHandler magic_mock(INFO)>" | assert | string_literal | tests/test_logger.py | test_valid_logging | TestLogger | 25 | null |
liiight/notifiers | import json
import pytest
from retry import retry
from notifiers.exceptions import BadArguments, NotificationError
provider = "telegram"
class TestTelegramResources:
resource = "updates"
def test_telegram_updates_attribs(self, resource):
assert resource.schema == {
"additionalProperties... | provider | assert | variable | tests/providers/test_telegram.py | test_telegram_updates_attribs | TestTelegramResources | 75 | null |
liiight/notifiers | import sys
import typing
import pytest
import notifiers
from notifiers import notify
from notifiers.core import SUCCESS_STATUS, Provider, Response
from notifiers.exceptions import (
BadArguments,
NoSuchNotifierError,
NotificationError,
SchemaError,
)
class TestCore:
valid_data: typing.ClassVar =... | resources | assert | variable | tests/test_core.py | test_resources | TestCore | 153 | null |
liiight/notifiers | import pytest
from notifiers.core import FAILURE_STATUS
from notifiers.exceptions import BadArguments, NotificationError
provider = "popcornnotify"
class TestPopcornNotify:
def test_popcornnotify_error(self, provider):
data = {"message": "foo", "api_key": "foo", "recipients": "foo@foo.com"}
rsp ... | FAILURE_STATUS | assert | variable | tests/providers/test_popcornnotify.py | test_popcornnotify_error | TestPopcornNotify | 40 | null |
liiight/notifiers | import pytest
from notifiers.exceptions import BadArguments, NotificationError, ResourceError
provider = "gitter"
class TestGitter:
def test_metadata(self, provider):
assert provider.metadata == | { "base_url": "https://api.gitter.im/v1/rooms", "message_url": "/{room_id}/chatMessages", "name": "gitter", "site_url": "https://gitter.im", } | assert | collection | tests/providers/test_gitter.py | test_metadata | TestGitter | 10 | null |
liiight/notifiers | from email.message import EmailMessage
import pytest
from notifiers.exceptions import BadArguments, NotificationError
provider = "email"
class TestSMTP:
def test_attachment_mimetypes(self, provider, tmpdir):
dir_ = tmpdir.mkdir("sub")
file_1 = dir_.join("foo.txt")
file_1.write("foo")
... | "application/pdf" | assert | string_literal | tests/providers/test_smtp.py | test_attachment_mimetypes | TestSMTP | 94 | null |
liiight/notifiers | import sys
import typing
import pytest
import notifiers
from notifiers import notify
from notifiers.core import SUCCESS_STATUS, Provider, Response
from notifiers.exceptions import (
BadArguments,
NoSuchNotifierError,
NotificationError,
SchemaError,
)
class TestCore:
valid_data: typing.ClassVar =... | "foo" | assert | string_literal | tests/test_core.py | test_environs | TestCore | 139 | null |
liiight/notifiers | import datetime
import pytest
from notifiers.exceptions import BadArguments, NotifierException
provider = "zulip"
class TestZulip:
@pytest.mark.parametrize(
("data", "message"),
[
(
{"email": "foo", "api_key": "bar", "message": "boo", "to": "bla"},
"d... | BadArguments) | pytest.raises | variable | tests/providers/test_zulip.py | test_missing_required | TestZulip | 40 | null |
liiight/notifiers | import datetime
import logging
import os
from time import sleep
import pytest
import requests
from notifiers.core import FAILURE_STATUS
from notifiers.exceptions import BadArguments, ResourceError
provider = "statuspage"
log = logging.getLogger("statuspage")
def close_all_open_incidents():
api_key = os.getenv(... | BadArguments, match=message) | pytest.raises | complex_expr | tests/providers/test_statuspage.py | test_data_dependencies | TestStatusPage | 89 | null |
liiight/notifiers | import pytest
from notifiers.exceptions import BadArguments, NotificationError
provider = "pushover"
class TestPushover:
@pytest.mark.parametrize(("data", "message"), [({}, "expire"), ({"expire": 30}, "retry")])
@pytest.mark.online
def test_pushover_priority_2_restrictions(self, data, message, provider,... | NotificationError) | pytest.raises | variable | tests/providers/test_pushover.py | test_pushover_priority_2_restrictions | TestPushover | 43 | null |
liiight/notifiers | import pytest
provider = "twilio"
class TestTwilio:
def test_twilio_metadata(self, provider):
assert provider.metadata == | { "base_url": "https://api.twilio.com/2010-04-01/Accounts/{}/Messages.json", "name": "twilio", "site_url": "https://www.twilio.com/", } | assert | collection | tests/providers/test_twilio.py | test_twilio_metadata | TestTwilio | 8 | null |
liiight/notifiers | import sys
import typing
import pytest
import notifiers
from notifiers import notify
from notifiers.core import SUCCESS_STATUS, Provider, Response
from notifiers.exceptions import (
BadArguments,
NoSuchNotifierError,
NotificationError,
SchemaError,
)
class TestCore:
valid_data: typing.ClassVar =... | notifiers.all_providers() | assert | func_call | tests/test_core.py | test_all_providers | TestCore | 100 | null |
liiight/notifiers | import sys
import typing
import pytest
import notifiers
from notifiers import notify
from notifiers.core import SUCCESS_STATUS, Provider, Response
from notifiers.exceptions import (
BadArguments,
NoSuchNotifierError,
NotificationError,
SchemaError,
)
class TestCore:
valid_data: typing.ClassVar =... | NotificationError) | pytest.raises | variable | tests/test_core.py | test_error_response | TestCore | 108 | null |
liiight/notifiers | from email.message import EmailMessage
import pytest
from notifiers.exceptions import BadArguments, NotificationError
provider = "email"
class TestSMTP:
@pytest.mark.parametrize(("data", "message"), [({}, "message"), ({"message": "foo"}, "to")])
def test_smtp_missing_required(self, data, message, provider)... | e.value.message | assert | complex_expr | tests/providers/test_smtp.py | test_smtp_missing_required | TestSMTP | 25 | null |
liiight/notifiers | import pytest
from notifiers.core import FAILURE_STATUS
from notifiers.exceptions import BadArguments, NotificationError
provider = "popcornnotify"
class TestPopcornNotify:
def test_popcornnotify_error(self, provider):
data = {"message": "foo", "api_key": "foo", "recipients": "foo@foo.com"}
rsp ... | NotificationError, match=error) | pytest.raises | complex_expr | tests/providers/test_popcornnotify.py | test_popcornnotify_error | TestPopcornNotify | 43 | null |
PedroBern/django-graphql-auth | from smtplib import SMTPException
from unittest import mock
from .testCases import RelayTestCase, DefaultTestCase
class SendSecondaryEmailActivationTestCaseMixin:
def setUp(self):
self.user1 = self.register_user(
email="gaa@email.com", username="gaa", verified=False
)
self.user... | True) | self.assertEqual | bool_literal | tests/test_send_secondary_email_activation.py | test_valid_email | SendSecondaryEmailActivationTestCaseMixin | 37 | null |
PedroBern/django-graphql-auth | from django.contrib.auth import get_user_model
from .testCases import RelayTestCase, DefaultTestCase
from graphql_auth.constants import Messages
from graphql_auth.utils import get_token, get_token_payload
from graphql_auth.models import UserStatus
from graphql_auth.signals import user_verified
class VerifyAccountCase... | executed["errors"]) | self.assertFalse | complex_expr | tests/test_verify_account.py | test_verify_user | VerifyAccountCaseMixin | 31 | null |
PedroBern/django-graphql-auth | from pytest import mark
from django.contrib.auth import get_user_model
from .testCases import RelayTestCase, DefaultTestCase
from .decorators import skipif_django_21
from graphql_auth.constants import Messages
class UpdateAccountTestCaseMixin:
def setUp(self):
self.user1 = self.register_user(
... | executed["errors"]["firstName"]) | self.assertTrue | complex_expr | tests/test_update_account.py | test_invalid_form | UpdateAccountTestCaseMixin | 47 | null |
PedroBern/django-graphql-auth | from django.test import TestCase
from .testCases import DefaultTestCase
class QueryTestCase(DefaultTestCase):
def setUp(self):
self.user1 = self.register_user(
email="foo@email.com", username="foo", verified=False
)
self.user2 = self.register_user(
email="bar@email.... | executed["edges"]) | self.assertTrue | complex_expr | tests/test_query.py | test_query | QueryTestCase | 34 | null |
PedroBern/django-graphql-auth | from django.contrib.auth import get_user_model
from graphql_auth.constants import Messages
from .testCases import RelayTestCase, DefaultTestCase
class SwapEmailsCaseMixin:
def setUp(self):
self.user = self.register_user(
email="bar@email.com",
username="bar",
verified=... | False) | self.assertEqual | bool_literal | tests/test_swap_emails.py | test_swap_emails_without_secondary_email | SwapEmailsCaseMixin | 31 | null |
PedroBern/django-graphql-auth | from django.contrib.auth import get_user_model
from graphql_jwt.refresh_token.models import RefreshToken
from .testCases import RelayTestCase, DefaultTestCase
from graphql_auth.utils import revoke_user_refresh_token
from graphql_auth.constants import Messages
from graphql_auth.utils import get_token, get_token_paylo... | executed["token"]) | self.assertTrue | complex_expr | tests/test_password_change.py | test_password_change | PasswordChangeTestCaseMixin | 27 | null |
PedroBern/django-graphql-auth | from django.contrib.auth import get_user_model
from .testCases import RelayTestCase, DefaultTestCase
from graphql_auth.constants import Messages
from graphql_auth.models import UserStatus
class ArchiveAccountTestCaseMixin:
def setUp(self):
self.user1 = self.register_user(email="foo@email.com", username="... | Messages.INVALID_PASSWORD) | self.assertEqual | complex_expr | tests/test_archive_account.py | test_invalid_password | ArchiveAccountTestCaseMixin | 33 | null |
PedroBern/django-graphql-auth | from smtplib import SMTPException
from unittest import mock
from pytest import mark
from django.contrib.auth import get_user_model
from .testCases import RelayTestCase, DefaultTestCase
from .decorators import skipif_django_21
from graphql_auth.constants import Messages
from graphql_auth.signals import user_register... | executed["errors"]["email"]) | self.assertTrue | complex_expr | tests/test_register.py | test_register_duplicate_unique_email | RegisterTestCaseMixin | 73 | null |
PedroBern/django-graphql-auth | from smtplib import SMTPException
from unittest import mock
from .testCases import RelayTestCase, DefaultTestCase
class SendSecondaryEmailActivationTestCaseMixin:
def setUp(self):
self.user1 = self.register_user(
email="gaa@email.com", username="gaa", verified=False
)
self.user... | False) | self.assertEqual | bool_literal | tests/test_send_secondary_email_activation.py | test_not_verified_user | SendSecondaryEmailActivationTestCaseMixin | 19 | null |
PedroBern/django-graphql-auth | from pytest import mark
from django.contrib.auth import get_user_model
from .testCases import RelayTestCase, DefaultTestCase
from .decorators import skipif_django_21
from graphql_auth.constants import Messages
class UpdateAccountTestCaseMixin:
def setUp(self):
self.user1 = self.register_user(
... | "first") | self.assertEqual | string_literal | tests/test_update_account.py | test_update_account_non_field_errors | UpdateAccountTestCaseMixin | 76 | null |
PedroBern/django-graphql-auth | from smtplib import SMTPException
from unittest import mock
from django.contrib.auth import get_user_model
from .testCases import RelayTestCase, DefaultTestCase
from graphql_auth.constants import Messages
class SendPasswordResetEmailTestCaseMixin:
def setUp(self):
self.user1 = self.register_user(
... | executed["errors"]["email"]) | self.assertTrue | complex_expr | tests/test_send_password_reset_email.py | test_invalid_form | SendPasswordResetEmailTestCaseMixin | 36 | null |
PedroBern/django-graphql-auth | from django.contrib.auth import get_user_model
from .testCases import RelayTestCase, DefaultTestCase
from graphql_auth.constants import Messages
from graphql_auth.utils import get_token
from graphql_auth.models import UserStatus
class VerifySecondaryEmailCaseMixin:
def setUp(self):
self.user = self.regist... | False) | self.assertEqual | bool_literal | tests/test_verify_secondary_email.py | test_invalid_token | VerifySecondaryEmailCaseMixin | 30 | null |
PedroBern/django-graphql-auth | from pytest import mark
from django.contrib.auth import get_user_model
from .testCases import RelayTestCase, DefaultTestCase
from .decorators import skipif_django_21
from graphql_auth.constants import Messages
class UpdateAccountTestCaseMixin:
def setUp(self):
self.user1 = self.register_user(
... | True) | self.assertEqual | bool_literal | tests/test_update_account.py | test_update_account | UpdateAccountTestCaseMixin | 36 | null |
PedroBern/django-graphql-auth | from django.contrib.auth import get_user_model
from .testCases import RelayTestCase, DefaultTestCase
from graphql_auth.constants import Messages
from graphql_auth.utils import get_token, get_token_payload
from graphql_auth.models import UserStatus
from graphql_auth.signals import user_verified
class VerifyAccountCase... | False) | self.assertEqual | bool_literal | tests/test_verify_account.py | test_verified_user | VerifyAccountCaseMixin | 37 | null |
PedroBern/django-graphql-auth | from smtplib import SMTPException
from unittest import mock
from pytest import mark
from django.contrib.auth import get_user_model
from .testCases import RelayTestCase, DefaultTestCase
from .decorators import skipif_django_21
from graphql_auth.constants import Messages
from graphql_auth.signals import user_register... | signal_received) | self.assertTrue | variable | tests/test_register.py | test_register | RegisterTestCaseMixin | 46 | null |
PedroBern/django-graphql-auth | from smtplib import SMTPException
from unittest import mock
from django.contrib.auth import get_user_model
from .testCases import RelayTestCase, DefaultTestCase
from graphql_auth.constants import Messages
class SendPasswordResetEmailTestCaseMixin:
def setUp(self):
self.user1 = self.register_user(
... | None) | self.assertEqual | none_literal | tests/test_send_password_reset_email.py | test_send_email_invalid_email | SendPasswordResetEmailTestCaseMixin | 30 | null |
PedroBern/django-graphql-auth | from pytest import mark
from django.contrib.auth import get_user_model
from .testCases import RelayTestCase, DefaultTestCase
from .decorators import skipif_django_21
from graphql_auth.constants import Messages
class UpdateAccountTestCaseMixin:
def setUp(self):
self.user1 = self.register_user(
... | Messages.UNAUTHENTICATED) | self.assertEqual | complex_expr | tests/test_update_account.py | test_update_account_unauthenticated | UpdateAccountTestCaseMixin | 25 | null |
PedroBern/django-graphql-auth | from pytest import mark
from django.contrib.auth import get_user_model
from .testCases import RelayTestCase, DefaultTestCase
from .decorators import skipif_django_21
from graphql_auth.constants import Messages
class UpdateAccountTestCaseMixin:
def setUp(self):
self.user1 = self.register_user(
... | "bar") | self.assertEqual | string_literal | tests/test_update_account.py | test_invalid_form | UpdateAccountTestCaseMixin | 49 | null |
PedroBern/django-graphql-auth | from pytest import mark
from django.contrib.auth import get_user_model
from .testCases import RelayTestCase, DefaultTestCase
from .decorators import skipif_django_21
from graphql_auth.constants import Messages
class UpdateAccountTestCaseMixin:
def setUp(self):
self.user1 = self.register_user(
... | False) | self.assertEqual | bool_literal | tests/test_update_account.py | test_update_account_unauthenticated | UpdateAccountTestCaseMixin | 24 | null |
PedroBern/django-graphql-auth | from django.contrib.auth import get_user_model
from .testCases import RelayTestCase, DefaultTestCase
from graphql_auth.constants import Messages
from graphql_auth.utils import get_token, get_token_payload
from graphql_auth.models import UserStatus
from graphql_auth.signals import user_verified
class VerifyAccountCase... | Messages.INVALID_TOKEN) | self.assertEqual | complex_expr | tests/test_verify_account.py | test_invalid_token | VerifyAccountCaseMixin | 45 | null |
PedroBern/django-graphql-auth | from pytest import mark
from django.contrib.auth import get_user_model
from .testCases import RelayTestCase, DefaultTestCase
from .decorators import skipif_django_21
from graphql_auth.constants import Messages
class UpdateAccountTestCaseMixin:
def setUp(self):
self.user1 = self.register_user(
... | Messages.NOT_VERIFIED) | self.assertEqual | complex_expr | tests/test_update_account.py | test_update_account_not_verified | UpdateAccountTestCaseMixin | 31 | null |
PedroBern/django-graphql-auth | from django.contrib.auth import get_user_model
from graphql_jwt.refresh_token.models import RefreshToken
from .testCases import RelayTestCase, DefaultTestCase
from graphql_auth.utils import revoke_user_refresh_token
from graphql_auth.constants import Messages
from graphql_auth.utils import get_token, get_token_paylo... | None) | self.assertEqual | none_literal | tests/test_password_change.py | test_password_change | PasswordChangeTestCaseMixin | 26 | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.