mirror of
https://github.com/chatmail/core.git
synced 2026-04-05 23:22:11 +03:00
A lot of work from @Hocuri and @Simon-Laux mostly. This exposes the API of the deltachat-provider-overview crate on the deltachat FFI API, allowing clients to use it to help users set up their accounts.
28 lines
943 B
Python
28 lines
943 B
Python
import pytest
|
|
|
|
from deltachat import const
|
|
from deltachat import provider
|
|
|
|
|
|
def test_provider_info_from_email():
|
|
example = provider.Provider.from_email("email@example.com")
|
|
assert example.overview_page == "https://providers.delta.chat/example.com"
|
|
assert example.name == "Example"
|
|
assert example.markdown == "\n..."
|
|
assert example.status_date == "2018-09"
|
|
assert example.status == const.DC_PROVIDER_STATUS_PREPARATION
|
|
|
|
|
|
def test_provider_info_from_domain():
|
|
example = provider.Provider("example.com")
|
|
assert example.overview_page == "https://providers.delta.chat/example.com"
|
|
assert example.name == "Example"
|
|
assert example.markdown == "\n..."
|
|
assert example.status_date == "2018-09"
|
|
assert example.status == const.DC_PROVIDER_STATUS_PREPARATION
|
|
|
|
|
|
def test_provider_info_none():
|
|
with pytest.raises(provider.ProviderNotFoundError):
|
|
provider.Provider.from_email("email@unexistent.no")
|