diff --git a/poetry.lock b/poetry.lock index ed9f1e4..38a1c80 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,6 +1,6 @@ [[package]] name = "anyio" -version = "2.2.0" +version = "3.6.1" description = "High level compatibility layer for multiple asynchronous event loop implementations" category = "dev" optional = false @@ -12,9 +12,8 @@ sniffio = ">=1.1" typing-extensions = {version = "*", markers = "python_version < \"3.8\""} [package.extras] -curio = ["curio (>=1.4)"] -doc = ["sphinx-rtd-theme", "sphinx-autodoc-typehints (>=1.2.0)"] -test = ["coverage[toml] (>=4.5)", "hypothesis (>=4.0)", "pytest (>=6.0)", "trustme", "uvloop (<0.15)", "uvloop (>=0.15)"] +doc = ["packaging", "sphinx-rtd-theme", "sphinx-autodoc-typehints (>=1.2.0)"] +test = ["coverage[toml] (>=4.5)", "hypothesis (>=4.0)", "pytest (>=7.0)", "pytest-mock (>=3.6.1)", "trustme", "contextlib2", "uvloop (<0.15)", "mock (>=4)", "uvloop (>=0.15)"] trio = ["trio (>=0.16)"] [[package]] @@ -67,12 +66,15 @@ python-versions = "*" pycparser = "*" [[package]] -name = "chardet" -version = "4.0.0" -description = "Universal encoding detector for Python 2 and 3" +name = "charset-normalizer" +version = "2.1.0" +description = "The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet." category = "main" optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" +python-versions = ">=3.6.0" + +[package.extras] +unicode_backport = ["unicodedata2"] [[package]] name = "colorama" @@ -90,19 +92,22 @@ category = "dev" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, <4" +[package.dependencies] +toml = {version = "*", optional = true, markers = "extra == \"toml\""} + [package.extras] toml = ["toml"] [[package]] name = "coveralls" -version = "3.0.1" +version = "3.3.1" description = "Show coverage stats online via coveralls.io" category = "dev" optional = false python-versions = ">= 3.5" [package.dependencies] -coverage = ">=4.1,<6.0" +coverage = ">=4.1,<6.0.0 || >6.1,<6.1.1 || >6.1.1,<7.0" docopt = ">=0.6.1" requests = ">=1.0.0" @@ -148,8 +153,8 @@ python-versions = ">=3.6" importlib-metadata = {version = "*", markers = "python_version < \"3.8\""} [package.extras] -docs = ["sphinx", "jaraco.packaging (>=8.2)", "rst.linker (>=1.9)"] -testing = ["pytest (>=4.6)", "pytest-checkdocs (>=2.4)", "pytest-flake8", "pytest-cov", "pytest-enabler (>=1.0.1)", "mock", "pytest-black (>=0.3.7)", "pytest-mypy"] +testing = ["pytest-mypy", "pytest-black (>=0.3.7)", "mock", "pytest-enabler (>=1.0.1)", "pytest-cov", "pytest-flake8", "pytest-checkdocs (>=2.4)", "pytest (>=4.6)"] +docs = ["rst.linker (>=1.9)", "jaraco.packaging (>=8.2)", "sphinx"] [[package]] name = "docopt" @@ -180,8 +185,8 @@ typing-extensions = {version = ">=3.6.4", markers = "python_version < \"3.8\""} zipp = ">=0.5" [package.extras] -docs = ["sphinx", "jaraco.packaging (>=8.2)", "rst.linker (>=1.9)"] -testing = ["pytest (>=3.5,!=3.7.3)", "pytest-checkdocs (>=1.2.3)", "pytest-flake8", "pytest-cov", "pytest-enabler", "packaging", "pep517", "pyfakefs", "flufl.flake8", "pytest-black (>=0.3.7)", "pytest-mypy", "importlib-resources (>=1.3)"] +testing = ["importlib-resources (>=1.3)", "pytest-mypy", "pytest-black (>=0.3.7)", "flufl.flake8", "pyfakefs", "pep517", "packaging", "pytest-enabler", "pytest-cov", "pytest-flake8", "pytest-checkdocs (>=1.2.3)", "pytest (>=3.5,!=3.7.3)"] +docs = ["rst.linker (>=1.9)", "jaraco.packaging (>=8.2)", "sphinx"] [[package]] name = "iniconfig" @@ -254,8 +259,8 @@ lxml = "*" requests = "*" [package.extras] -dev = ["tox", "twine", "therapist", "black", "flake8", "wheel"] -test = ["nose", "mock"] +test = ["mock", "nose"] +dev = ["wheel", "flake8", "black", "therapist", "twine", "tox"] [[package]] name = "py" @@ -291,11 +296,11 @@ python-versions = "*" [[package]] name = "pytest" -version = "6.2.2" +version = "7.1.2" description = "pytest: simple powerful testing with Python" category = "dev" optional = false -python-versions = ">=3.6" +python-versions = ">=3.7" [package.dependencies] atomicwrites = {version = ">=1.0", markers = "sys_platform == \"win32\""} @@ -304,45 +309,45 @@ colorama = {version = "*", markers = "sys_platform == \"win32\""} importlib-metadata = {version = ">=0.12", markers = "python_version < \"3.8\""} iniconfig = "*" packaging = "*" -pluggy = ">=0.12,<1.0.0a1" +pluggy = ">=0.12,<2.0" py = ">=1.8.2" -toml = "*" +tomli = ">=1.0.0" [package.extras] -testing = ["argcomplete", "hypothesis (>=3.56)", "mock", "nose", "requests", "xmlschema"] +testing = ["argcomplete", "hypothesis (>=3.56)", "mock", "nose", "pygments (>=2.7.2)", "requests", "xmlschema"] [[package]] name = "pytest-cov" -version = "2.11.1" +version = "3.0.0" description = "Pytest plugin for measuring coverage." category = "dev" optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" +python-versions = ">=3.6" [package.dependencies] -coverage = ">=5.2.1" +coverage = {version = ">=5.2.1", extras = ["toml"]} pytest = ">=4.6" [package.extras] -testing = ["fields", "hunter", "process-tests (==2.0.2)", "six", "pytest-xdist", "virtualenv"] +testing = ["virtualenv", "pytest-xdist", "six", "process-tests", "hunter", "fields"] [[package]] name = "pytest-mock" -version = "3.5.1" +version = "3.8.2" description = "Thin-wrapper around the mock package for easier use with pytest" category = "dev" optional = false -python-versions = ">=3.5" +python-versions = ">=3.7" [package.dependencies] pytest = ">=5.0" [package.extras] -dev = ["pre-commit", "tox", "pytest-asyncio"] +dev = ["pytest-asyncio", "tox", "pre-commit"] [[package]] name = "pytest-recording" -version = "0.12.0" +version = "0.12.1" description = "A pytest plugin that allows you recording of network interactions via VCR.py" category = "dev" optional = false @@ -355,7 +360,7 @@ vcrpy = ">=2.0.1" [[package]] name = "pytest-spec" -version = "3.1.0" +version = "3.2.0" description = "Library pytest-spec is a pytest plugin to display test execution output like a SPECIFICATION." category = "dev" optional = false @@ -366,7 +371,7 @@ six = "*" [[package]] name = "pytest-sugar" -version = "0.9.4" +version = "0.9.5" description = "pytest-sugar is a plugin for pytest that changes the default look and feel of pytest (e.g. progressbar, show tests that fail instantly)." category = "dev" optional = false @@ -379,25 +384,25 @@ termcolor = ">=1.1.0" [[package]] name = "pytest-timeout" -version = "1.4.2" -description = "py.test plugin to abort hanging tests" +version = "2.1.0" +description = "pytest plugin to abort hanging tests" category = "dev" optional = false -python-versions = "*" +python-versions = ">=3.6" [package.dependencies] -pytest = ">=3.6.0" +pytest = ">=5.0.0" [[package]] name = "pytest-vcr-delete-on-fail" -version = "0.9.0" +version = "2.0.0" description = "A pytest plugin that automates vcrpy cassettes deletion on test failure." category = "dev" optional = false python-versions = ">=3.7,<4.0" [package.dependencies] -pytest = ">=6.2.2,<7.0.0" +pytest = ">=6.2.2" [[package]] name = "python-dotenv" @@ -412,11 +417,11 @@ cli = ["click (>=5.0)"] [[package]] name = "pyyaml" -version = "5.4.1" +version = "6.0" description = "YAML parser and emitter for Python" category = "dev" optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*" +python-versions = ">=3.6" [[package]] name = "random-username" @@ -428,21 +433,21 @@ python-versions = "*" [[package]] name = "requests" -version = "2.25.1" +version = "2.28.1" description = "Python HTTP for Humans." category = "main" optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" +python-versions = ">=3.7, <4" [package.dependencies] certifi = ">=2017.4.17" -chardet = ">=3.0.2,<5" -idna = ">=2.5,<3" +charset-normalizer = ">=2,<3" +idna = ">=2.5,<4" urllib3 = ">=1.21.1,<1.27" [package.extras] -security = ["pyOpenSSL (>=0.14)", "cryptography (>=1.3.4)"] -socks = ["PySocks (>=1.5.6,!=1.5.7)", "win-inet-pton"] +socks = ["PySocks (>=1.5.6,!=1.5.7)"] +use_chardet_on_py3 = ["chardet (>=3.0.2,<6)"] [[package]] name = "six" @@ -476,6 +481,14 @@ category = "dev" optional = false python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*" +[[package]] +name = "tomli" +version = "2.0.1" +description = "A lil' TOML parser" +category = "dev" +optional = false +python-versions = ">=3.7" + [[package]] name = "typing-extensions" version = "3.7.4.3" @@ -533,7 +546,7 @@ python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,>=2.7" [[package]] name = "yagmail" -version = "0.14.245" +version = "0.15.283" description = "Yet Another GMAIL client" category = "dev" optional = false @@ -543,7 +556,8 @@ python-versions = "*" premailer = "*" [package.extras] -all = ["keyring"] +dkim = ["dkimpy"] +all = ["dkimpy", "keyring"] [[package]] name = "yarl" @@ -573,12 +587,12 @@ testing = ["pytest (>=4.6)", "pytest-checkdocs (>=1.2.3)", "pytest-flake8", "pyt [metadata] lock-version = "1.1" python-versions = "^3.7" -content-hash = "a95086fc20ef80220255716ab6179caa1329e4abae209b6e15fb6a51b2e9a4c7" +content-hash = "5195f0b899d46b2cebd7e2e368e8ceb27925def8701199f52ecf1879b50d785c" [metadata.files] anyio = [ - {file = "anyio-2.2.0-py3-none-any.whl", hash = "sha256:aa3da546ed17f097ca876c78024dea380a3b7fa80759abfdda59f12176a3dac8"}, - {file = "anyio-2.2.0.tar.gz", hash = "sha256:4a41c5b3a65ed92e469d51b6fba3779301850ea2e352afcf9e36c46f21ee14a9"}, + {file = "anyio-3.6.1-py3-none-any.whl", hash = "sha256:cb29b9c70620506a9a8f87a309591713446953302d7d995344d0d7c6c0c9a7be"}, + {file = "anyio-3.6.1.tar.gz", hash = "sha256:413adf95f93886e442aea925f3ee43baa5a765a64a0f52c6081894f9992fdd0b"}, ] atomicwrites = [ {file = "atomicwrites-1.4.0-py2.py3-none-any.whl", hash = "sha256:6d1784dea7c0c8d4a5172b6c620f40b6e4cbfdf96d783691f2e1302a7b88e197"}, @@ -648,9 +662,9 @@ cffi = [ {file = "cffi-1.15.0-cp39-cp39-win_amd64.whl", hash = "sha256:3773c4d81e6e818df2efbc7dd77325ca0dcb688116050fb2b3011218eda36139"}, {file = "cffi-1.15.0.tar.gz", hash = "sha256:920f0d66a896c2d99f0adbb391f990a84091179542c205fa53ce5787aff87954"}, ] -chardet = [ - {file = "chardet-4.0.0-py2.py3-none-any.whl", hash = "sha256:f864054d66fd9118f2e67044ac8981a54775ec5b67aed0441892edb553d21da5"}, - {file = "chardet-4.0.0.tar.gz", hash = "sha256:0d6f53a15db4120f2b08c94f11e7d93d2c911ee118b6b30a04ec3ee8310179fa"}, +charset-normalizer = [ + {file = "charset-normalizer-2.1.0.tar.gz", hash = "sha256:575e708016ff3a5e3681541cb9d79312c416835686d054a23accb873b254f413"}, + {file = "charset_normalizer-2.1.0-py3-none-any.whl", hash = "sha256:5189b6f22b01957427f35b6a08d9a0bc45b46d3788ef5a92e978433c7a35f8a5"}, ] colorama = [ {file = "colorama-0.4.4-py2.py3-none-any.whl", hash = "sha256:9f47eda37229f68eee03b24b9748937c7dc3868f906e8ba69fbcbdd3bc5dc3e2"}, @@ -711,8 +725,8 @@ coverage = [ {file = "coverage-5.5.tar.gz", hash = "sha256:ebe78fe9a0e874362175b02371bdfbee64d8edc42a044253ddf4ee7d3c15212c"}, ] coveralls = [ - {file = "coveralls-3.0.1-py2.py3-none-any.whl", hash = "sha256:7bd173b3425733661ba3063c88f180127cc2b20e9740686f86d2622b31b41385"}, - {file = "coveralls-3.0.1.tar.gz", hash = "sha256:cbb942ae5ef3d2b55388cb5b43e93a269544911535f1e750e1c656aef019ce60"}, + {file = "coveralls-3.3.1-py2.py3-none-any.whl", hash = "sha256:f42015f31d386b351d4226389b387ae173207058832fbf5c8ec4b40e27b16026"}, + {file = "coveralls-3.3.1.tar.gz", hash = "sha256:b32a8bb5d2df585207c119d6c01567b81fba690c9c10a753bfe27a335bfc43ea"}, ] cryptography = [ {file = "cryptography-3.4.8-cp36-abi3-macosx_10_10_x86_64.whl", hash = "sha256:a00cf305f07b26c351d8d4e1af84ad7501eca8a342dedf24a7acb0e7b7406e14"}, @@ -897,78 +911,83 @@ pyperclip = [ {file = "pyperclip-1.8.2.tar.gz", hash = "sha256:105254a8b04934f0bc84e9c24eb360a591aaf6535c9def5f29d92af107a9bf57"}, ] pytest = [ - {file = "pytest-6.2.2-py3-none-any.whl", hash = "sha256:b574b57423e818210672e07ca1fa90aaf194a4f63f3ab909a2c67ebb22913839"}, - {file = "pytest-6.2.2.tar.gz", hash = "sha256:9d1edf9e7d0b84d72ea3dbcdfd22b35fb543a5e8f2a60092dd578936bf63d7f9"}, + {file = "pytest-7.1.2-py3-none-any.whl", hash = "sha256:13d0e3ccfc2b6e26be000cb6568c832ba67ba32e719443bfe725814d3c42433c"}, + {file = "pytest-7.1.2.tar.gz", hash = "sha256:a06a0425453864a270bc45e71f783330a7428defb4230fb5e6a731fde06ecd45"}, ] pytest-cov = [ - {file = "pytest-cov-2.11.1.tar.gz", hash = "sha256:359952d9d39b9f822d9d29324483e7ba04a3a17dd7d05aa6beb7ea01e359e5f7"}, - {file = "pytest_cov-2.11.1-py2.py3-none-any.whl", hash = "sha256:bdb9fdb0b85a7cc825269a4c56b48ccaa5c7e365054b6038772c32ddcdc969da"}, + {file = "pytest-cov-3.0.0.tar.gz", hash = "sha256:e7f0f5b1617d2210a2cabc266dfe2f4c75a8d32fb89eafb7ad9d06f6d076d470"}, + {file = "pytest_cov-3.0.0-py3-none-any.whl", hash = "sha256:578d5d15ac4a25e5f961c938b85a05b09fdaae9deef3bb6de9a6e766622ca7a6"}, ] pytest-mock = [ - {file = "pytest-mock-3.5.1.tar.gz", hash = "sha256:a1e2aba6af9560d313c642dae7e00a2a12b022b80301d9d7fc8ec6858e1dd9fc"}, - {file = "pytest_mock-3.5.1-py3-none-any.whl", hash = "sha256:379b391cfad22422ea2e252bdfc008edd08509029bcde3c25b2c0bd741e0424e"}, + {file = "pytest-mock-3.8.2.tar.gz", hash = "sha256:77f03f4554392558700295e05aed0b1096a20d4a60a4f3ddcde58b0c31c8fca2"}, + {file = "pytest_mock-3.8.2-py3-none-any.whl", hash = "sha256:8a9e226d6c0ef09fcf20c94eb3405c388af438a90f3e39687f84166da82d5948"}, ] pytest-recording = [ - {file = "pytest-recording-0.12.0.tar.gz", hash = "sha256:9039bf488f80c016055ffd039a91e33b1e89f3ee2ee0005c0bbce298fd417ee1"}, - {file = "pytest_recording-0.12.0-py3-none-any.whl", hash = "sha256:a94b000640fe5d05b34fa9e25dca1671dd7f21195502c5f4d2f600c31dc14f7e"}, + {file = "pytest-recording-0.12.1.tar.gz", hash = "sha256:0d1f36d10dea5090cab8ecd230e5dc937c97b9fed193874b330d2926ddea028f"}, + {file = "pytest_recording-0.12.1-py3-none-any.whl", hash = "sha256:6b5546b822b270b8d7338f70950453be45e4aa5bfd884d97583dfa47288380f9"}, ] pytest-spec = [ - {file = "pytest-spec-3.1.0.tar.gz", hash = "sha256:5d94926fa60b1c6019b7b62ee5c8d30f18b25b789c548751986c8fed30e47f08"}, - {file = "pytest_spec-3.1.0-py2.py3-none-any.whl", hash = "sha256:5e1099c28478368218068a3729f255f0681f00bb0b5e340b7f174b551c78fef6"}, + {file = "pytest-spec-3.2.0.tar.gz", hash = "sha256:4af154588195f4bb6c62d6ca030a20218db7d80b675a08897d9a99239ea3d087"}, + {file = "pytest_spec-3.2.0-py2.py3-none-any.whl", hash = "sha256:128dd1e133c72d6a18b28ed96d0af0fc43aece8f796ebcfcd81c850f0094b62e"}, ] pytest-sugar = [ - {file = "pytest-sugar-0.9.4.tar.gz", hash = "sha256:b1b2186b0a72aada6859bea2a5764145e3aaa2c1cfbb23c3a19b5f7b697563d3"}, + {file = "pytest-sugar-0.9.5.tar.gz", hash = "sha256:eea78b6f15b635277d3d90280cd386d8feea1cab0f9be75947a626e8b02b477d"}, + {file = "pytest_sugar-0.9.5-py2.py3-none-any.whl", hash = "sha256:3da42de32ce4e1e95b448d61c92804433f5d4058c0a765096991c2e93d5a289f"}, ] pytest-timeout = [ - {file = "pytest-timeout-1.4.2.tar.gz", hash = "sha256:20b3113cf6e4e80ce2d403b6fb56e9e1b871b510259206d40ff8d609f48bda76"}, - {file = "pytest_timeout-1.4.2-py2.py3-none-any.whl", hash = "sha256:541d7aa19b9a6b4e475c759fd6073ef43d7cdc9a92d95644c260076eb257a063"}, + {file = "pytest-timeout-2.1.0.tar.gz", hash = "sha256:c07ca07404c612f8abbe22294b23c368e2e5104b521c1790195561f37e1ac3d9"}, + {file = "pytest_timeout-2.1.0-py3-none-any.whl", hash = "sha256:f6f50101443ce70ad325ceb4473c4255e9d74e3c7cd0ef827309dfa4c0d975c6"}, ] pytest-vcr-delete-on-fail = [ - {file = "pytest-vcr-delete-on-fail-0.9.0.tar.gz", hash = "sha256:86554a37f91c5aca959efd930fcea09c8183b0e183fb07aa249ed5a0f28f03f9"}, - {file = "pytest_vcr_delete_on_fail-0.9.0-py3-none-any.whl", hash = "sha256:15539275394d2f4cf19efceec8c76542c6950f80be301b11ee22e0a2a2b55552"}, + {file = "pytest-vcr-delete-on-fail-2.0.0.tar.gz", hash = "sha256:c1f81150ce6f3673f31943d69d2f27bad0d3651ae1db1ef82e7ba1ed73169dbb"}, + {file = "pytest_vcr_delete_on_fail-2.0.0-py3-none-any.whl", hash = "sha256:79d084e1fa4a7ef00b00b2a77c62bda044c9afbd5d87a8122f85d9d3df5e99d5"}, ] python-dotenv = [ {file = "python-dotenv-0.20.0.tar.gz", hash = "sha256:b7e3b04a59693c42c36f9ab1cc2acc46fa5df8c78e178fc33a8d4cd05c8d498f"}, {file = "python_dotenv-0.20.0-py3-none-any.whl", hash = "sha256:d92a187be61fe482e4fd675b6d52200e7be63a12b724abbf931a40ce4fa92938"}, ] pyyaml = [ - {file = "PyYAML-5.4.1-cp27-cp27m-macosx_10_9_x86_64.whl", hash = "sha256:3b2b1824fe7112845700f815ff6a489360226a5609b96ec2190a45e62a9fc922"}, - {file = "PyYAML-5.4.1-cp27-cp27m-win32.whl", hash = "sha256:129def1b7c1bf22faffd67b8f3724645203b79d8f4cc81f674654d9902cb4393"}, - {file = "PyYAML-5.4.1-cp27-cp27m-win_amd64.whl", hash = "sha256:4465124ef1b18d9ace298060f4eccc64b0850899ac4ac53294547536533800c8"}, - {file = "PyYAML-5.4.1-cp27-cp27mu-manylinux1_x86_64.whl", hash = "sha256:bb4191dfc9306777bc594117aee052446b3fa88737cd13b7188d0e7aa8162185"}, - {file = "PyYAML-5.4.1-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:6c78645d400265a062508ae399b60b8c167bf003db364ecb26dcab2bda048253"}, - {file = "PyYAML-5.4.1-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:4e0583d24c881e14342eaf4ec5fbc97f934b999a6828693a99157fde912540cc"}, - {file = "PyYAML-5.4.1-cp36-cp36m-manylinux2014_aarch64.whl", hash = "sha256:72a01f726a9c7851ca9bfad6fd09ca4e090a023c00945ea05ba1638c09dc3347"}, - {file = "PyYAML-5.4.1-cp36-cp36m-manylinux2014_s390x.whl", hash = "sha256:895f61ef02e8fed38159bb70f7e100e00f471eae2bc838cd0f4ebb21e28f8541"}, - {file = "PyYAML-5.4.1-cp36-cp36m-win32.whl", hash = "sha256:3bd0e463264cf257d1ffd2e40223b197271046d09dadf73a0fe82b9c1fc385a5"}, - {file = "PyYAML-5.4.1-cp36-cp36m-win_amd64.whl", hash = "sha256:e4fac90784481d221a8e4b1162afa7c47ed953be40d31ab4629ae917510051df"}, - {file = "PyYAML-5.4.1-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:5accb17103e43963b80e6f837831f38d314a0495500067cb25afab2e8d7a4018"}, - {file = "PyYAML-5.4.1-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:e1d4970ea66be07ae37a3c2e48b5ec63f7ba6804bdddfdbd3cfd954d25a82e63"}, - {file = "PyYAML-5.4.1-cp37-cp37m-manylinux2014_aarch64.whl", hash = "sha256:cb333c16912324fd5f769fff6bc5de372e9e7a202247b48870bc251ed40239aa"}, - {file = "PyYAML-5.4.1-cp37-cp37m-manylinux2014_s390x.whl", hash = "sha256:fe69978f3f768926cfa37b867e3843918e012cf83f680806599ddce33c2c68b0"}, - {file = "PyYAML-5.4.1-cp37-cp37m-win32.whl", hash = "sha256:dd5de0646207f053eb0d6c74ae45ba98c3395a571a2891858e87df7c9b9bd51b"}, - {file = "PyYAML-5.4.1-cp37-cp37m-win_amd64.whl", hash = "sha256:08682f6b72c722394747bddaf0aa62277e02557c0fd1c42cb853016a38f8dedf"}, - {file = "PyYAML-5.4.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:d2d9808ea7b4af864f35ea216be506ecec180628aced0704e34aca0b040ffe46"}, - {file = "PyYAML-5.4.1-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:8c1be557ee92a20f184922c7b6424e8ab6691788e6d86137c5d93c1a6ec1b8fb"}, - {file = "PyYAML-5.4.1-cp38-cp38-manylinux2014_aarch64.whl", hash = "sha256:fd7f6999a8070df521b6384004ef42833b9bd62cfee11a09bda1079b4b704247"}, - {file = "PyYAML-5.4.1-cp38-cp38-manylinux2014_s390x.whl", hash = "sha256:bfb51918d4ff3d77c1c856a9699f8492c612cde32fd3bcd344af9be34999bfdc"}, - {file = "PyYAML-5.4.1-cp38-cp38-win32.whl", hash = "sha256:fa5ae20527d8e831e8230cbffd9f8fe952815b2b7dae6ffec25318803a7528fc"}, - {file = "PyYAML-5.4.1-cp38-cp38-win_amd64.whl", hash = "sha256:0f5f5786c0e09baddcd8b4b45f20a7b5d61a7e7e99846e3c799b05c7c53fa696"}, - {file = "PyYAML-5.4.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:294db365efa064d00b8d1ef65d8ea2c3426ac366c0c4368d930bf1c5fb497f77"}, - {file = "PyYAML-5.4.1-cp39-cp39-manylinux1_x86_64.whl", hash = "sha256:74c1485f7707cf707a7aef42ef6322b8f97921bd89be2ab6317fd782c2d53183"}, - {file = "PyYAML-5.4.1-cp39-cp39-manylinux2014_aarch64.whl", hash = "sha256:d483ad4e639292c90170eb6f7783ad19490e7a8defb3e46f97dfe4bacae89122"}, - {file = "PyYAML-5.4.1-cp39-cp39-manylinux2014_s390x.whl", hash = "sha256:fdc842473cd33f45ff6bce46aea678a54e3d21f1b61a7750ce3c498eedfe25d6"}, - {file = "PyYAML-5.4.1-cp39-cp39-win32.whl", hash = "sha256:49d4cdd9065b9b6e206d0595fee27a96b5dd22618e7520c33204a4a3239d5b10"}, - {file = "PyYAML-5.4.1-cp39-cp39-win_amd64.whl", hash = "sha256:c20cfa2d49991c8b4147af39859b167664f2ad4561704ee74c1de03318e898db"}, - {file = "PyYAML-5.4.1.tar.gz", hash = "sha256:607774cbba28732bfa802b54baa7484215f530991055bb562efbed5b2f20a45e"}, + {file = "PyYAML-6.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:d4db7c7aef085872ef65a8fd7d6d09a14ae91f691dec3e87ee5ee0539d516f53"}, + {file = "PyYAML-6.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:9df7ed3b3d2e0ecfe09e14741b857df43adb5a3ddadc919a2d94fbdf78fea53c"}, + {file = "PyYAML-6.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:77f396e6ef4c73fdc33a9157446466f1cff553d979bd00ecb64385760c6babdc"}, + {file = "PyYAML-6.0-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a80a78046a72361de73f8f395f1f1e49f956c6be882eed58505a15f3e430962b"}, + {file = "PyYAML-6.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:f84fbc98b019fef2ee9a1cb3ce93e3187a6df0b2538a651bfb890254ba9f90b5"}, + {file = "PyYAML-6.0-cp310-cp310-win32.whl", hash = "sha256:2cd5df3de48857ed0544b34e2d40e9fac445930039f3cfe4bcc592a1f836d513"}, + {file = "PyYAML-6.0-cp310-cp310-win_amd64.whl", hash = "sha256:daf496c58a8c52083df09b80c860005194014c3698698d1a57cbcfa182142a3a"}, + {file = "PyYAML-6.0-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:897b80890765f037df3403d22bab41627ca8811ae55e9a722fd0392850ec4d86"}, + {file = "PyYAML-6.0-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:50602afada6d6cbfad699b0c7bb50d5ccffa7e46a3d738092afddc1f9758427f"}, + {file = "PyYAML-6.0-cp36-cp36m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:48c346915c114f5fdb3ead70312bd042a953a8ce5c7106d5bfb1a5254e47da92"}, + {file = "PyYAML-6.0-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:98c4d36e99714e55cfbaaee6dd5badbc9a1ec339ebfc3b1f52e293aee6bb71a4"}, + {file = "PyYAML-6.0-cp36-cp36m-win32.whl", hash = "sha256:0283c35a6a9fbf047493e3a0ce8d79ef5030852c51e9d911a27badfde0605293"}, + {file = "PyYAML-6.0-cp36-cp36m-win_amd64.whl", hash = "sha256:07751360502caac1c067a8132d150cf3d61339af5691fe9e87803040dbc5db57"}, + {file = "PyYAML-6.0-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:819b3830a1543db06c4d4b865e70ded25be52a2e0631ccd2f6a47a2822f2fd7c"}, + {file = "PyYAML-6.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:473f9edb243cb1935ab5a084eb238d842fb8f404ed2193a915d1784b5a6b5fc0"}, + {file = "PyYAML-6.0-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:0ce82d761c532fe4ec3f87fc45688bdd3a4c1dc5e0b4a19814b9009a29baefd4"}, + {file = "PyYAML-6.0-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:231710d57adfd809ef5d34183b8ed1eeae3f76459c18fb4a0b373ad56bedcdd9"}, + {file = "PyYAML-6.0-cp37-cp37m-win32.whl", hash = "sha256:c5687b8d43cf58545ade1fe3e055f70eac7a5a1a0bf42824308d868289a95737"}, + {file = "PyYAML-6.0-cp37-cp37m-win_amd64.whl", hash = "sha256:d15a181d1ecd0d4270dc32edb46f7cb7733c7c508857278d3d378d14d606db2d"}, + {file = "PyYAML-6.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:0b4624f379dab24d3725ffde76559cff63d9ec94e1736b556dacdfebe5ab6d4b"}, + {file = "PyYAML-6.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:213c60cd50106436cc818accf5baa1aba61c0189ff610f64f4a3e8c6726218ba"}, + {file = "PyYAML-6.0-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:9fa600030013c4de8165339db93d182b9431076eb98eb40ee068700c9c813e34"}, + {file = "PyYAML-6.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:277a0ef2981ca40581a47093e9e2d13b3f1fbbeffae064c1d21bfceba2030287"}, + {file = "PyYAML-6.0-cp38-cp38-win32.whl", hash = "sha256:d4eccecf9adf6fbcc6861a38015c2a64f38b9d94838ac1810a9023a0609e1b78"}, + {file = "PyYAML-6.0-cp38-cp38-win_amd64.whl", hash = "sha256:1e4747bc279b4f613a09eb64bba2ba602d8a6664c6ce6396a4d0cd413a50ce07"}, + {file = "PyYAML-6.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:055d937d65826939cb044fc8c9b08889e8c743fdc6a32b33e2390f66013e449b"}, + {file = "PyYAML-6.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:e61ceaab6f49fb8bdfaa0f92c4b57bcfbea54c09277b1b4f7ac376bfb7a7c174"}, + {file = "PyYAML-6.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d67d839ede4ed1b28a4e8909735fc992a923cdb84e618544973d7dfc71540803"}, + {file = "PyYAML-6.0-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:cba8c411ef271aa037d7357a2bc8f9ee8b58b9965831d9e51baf703280dc73d3"}, + {file = "PyYAML-6.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:40527857252b61eacd1d9af500c3337ba8deb8fc298940291486c465c8b46ec0"}, + {file = "PyYAML-6.0-cp39-cp39-win32.whl", hash = "sha256:b5b9eccad747aabaaffbc6064800670f0c297e52c12754eb1d976c57e4f74dcb"}, + {file = "PyYAML-6.0-cp39-cp39-win_amd64.whl", hash = "sha256:b3d267842bf12586ba6c734f89d1f5b871df0273157918b0ccefa29deb05c21c"}, + {file = "PyYAML-6.0.tar.gz", hash = "sha256:68fb519c14306fec9720a2a5b45bc9f0c8d1b9c72adf45c37baedfcd949c35a2"}, ] random-username = [ {file = "random-username-1.0.2.tar.gz", hash = "sha256:5fdc0604b5d1bdfe4acf4cd7491a9de1caf41bbdd890f646b434e09ae2a1b7ce"}, {file = "random_username-1.0.2-py3-none-any.whl", hash = "sha256:2536feb63fecde7e01ede4a541aadb6f0b58794a7ab327ca5369d2a4b7664c06"}, ] requests = [ - {file = "requests-2.25.1-py2.py3-none-any.whl", hash = "sha256:c210084e36a42ae6b9219e00e48287def368a26d03a048ddad7bfee44f75871e"}, - {file = "requests-2.25.1.tar.gz", hash = "sha256:27973dd4a904a4f13b263a19c866c13b92a39ed1c964655f025f3f8d3d75b804"}, + {file = "requests-2.28.1-py3-none-any.whl", hash = "sha256:8fefa2a1a1365bf5520aac41836fbee479da67864514bdb821f31ce07ce65349"}, + {file = "requests-2.28.1.tar.gz", hash = "sha256:7c5599b102feddaa661c826c56ab4fee28bfd17f5abca1ebbe3e7f19d7c97983"}, ] six = [ {file = "six-1.15.0-py2.py3-none-any.whl", hash = "sha256:8b74bedcbbbaca38ff6d7491d76f2b06b3592611af620f8426e82dddb04a5ced"}, @@ -985,6 +1004,10 @@ toml = [ {file = "toml-0.10.2-py2.py3-none-any.whl", hash = "sha256:806143ae5bfb6a3c6e736a764057db0e6a0e05e338b5630894a5f779cabb4f9b"}, {file = "toml-0.10.2.tar.gz", hash = "sha256:b3bda1d108d5dd99f4a20d24d9c348e91c4db7ab1b749200bded2f839ccbe68f"}, ] +tomli = [ + {file = "tomli-2.0.1-py3-none-any.whl", hash = "sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc"}, + {file = "tomli-2.0.1.tar.gz", hash = "sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f"}, +] typing-extensions = [ {file = "typing_extensions-3.7.4.3-py2-none-any.whl", hash = "sha256:dafc7639cde7f1b6e1acc0f457842a83e722ccca8eef5270af2d74792619a89f"}, {file = "typing_extensions-3.7.4.3-py3-none-any.whl", hash = "sha256:7cb407020f00f7bfc3cb3e7881628838e69d8f3fcab2f64742a5e76b2f841918"}, @@ -1069,8 +1092,8 @@ wrapt = [ {file = "wrapt-1.14.0.tar.gz", hash = "sha256:8323a43bd9c91f62bb7d4be74cc9ff10090e7ef820e27bfe8815c57e68261311"}, ] yagmail = [ - {file = "yagmail-0.14.245-py2.py3-none-any.whl", hash = "sha256:9b84392ae15c82b73a0c0a86a9ecb64e836a95a92df9211accba6ed60bd57d13"}, - {file = "yagmail-0.14.245.tar.gz", hash = "sha256:b1ad2d7d8be71fa2861d5c68bbf83858f0ab89f08d01180e2144216b063dce61"}, + {file = "yagmail-0.15.283-py2.py3-none-any.whl", hash = "sha256:f4cdcfbe699bbc994ce974e0ae8fc5867c6f77a87fc5770b3f54fc8b12bbd668"}, + {file = "yagmail-0.15.283.tar.gz", hash = "sha256:f7f50ac7d0c00cf47f67700cec5073ede167d6a71fae4ab84d7b179041ec5429"}, ] yarl = [ {file = "yarl-1.7.2-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:f2a8508f7350512434e41065684076f640ecce176d262a7d54f0da41d99c5a95"}, diff --git a/pymailtm/pymailtm.py b/pymailtm/pymailtm.py index f4e306f..67b4d5e 100644 --- a/pymailtm/pymailtm.py +++ b/pymailtm/pymailtm.py @@ -11,11 +11,11 @@ from pathlib import Path from tempfile import NamedTemporaryFile from time import sleep -from typing import Dict +from typing import Dict, List class Account: - """Representing a temprary mailbox.""" + """Representing a temporary mailbox.""" def __init__(self, id, address, password): self.id_ = id @@ -35,14 +35,23 @@ def get_messages(self, page=1): """Download a list of messages currently in the account.""" r = requests.get("{}/messages?page={}".format(self.api_address, page), headers=self.auth_headers) + if r.status_code != 200: + raise CouldNotGetMessagesException(f"Get message list: HTTP {r.status_code}") + messages = [] for message_data in r.json()["hydra:member"]: - # recover full message + sleep(2) + # recover the full message r = requests.get( f"{self.api_address}/messages/{message_data['id']}", headers=self.auth_headers) - text = r.json()["text"] - html = r.json()["html"] - # prepare the mssage object + if r.status_code != 200: + raise CouldNotGetMessagesException(f"Get message: HTTP {r.status_code}") + + full_message_json = r.json() + text = full_message_json["text"] + html = full_message_json["html"] + + # prepare the message object and append it to the list messages.append(Message( message_data["id"], message_data["from"], @@ -52,6 +61,7 @@ def get_messages(self, page=1): text, html, message_data)) + return messages def delete_account(self): @@ -62,10 +72,25 @@ def delete_account(self): def wait_for_message(self): """Wait for a new message to arrive, then return it.""" - start = len(self.get_messages()) - while len(self.get_messages()) == start: - sleep(1) - return self.get_messages()[0] + old_messages_id = self._get_existing_messages_id() + + while True: + sleep(2) + try: + new_messages = list(filter(lambda m: m.id_ not in old_messages_id, self.get_messages())) + if new_messages: + return new_messages[0] + except CouldNotGetMessagesException: + pass + + def _get_existing_messages_id(self) -> List[int]: + """Return the existing messages id list. This will keep trying, ignoring errors.""" + while True: + try: + old_messages = self.get_messages() + return list(map(lambda m: m.id_, old_messages)) + except CouldNotGetMessagesException: + sleep(3) def monitor_account(self): """Keep waiting for new messages and open them in the browser.""" @@ -124,8 +149,12 @@ def open_webbrowser(link: str) -> None: os.dup2(saverr, 2) +class CouldNotGetMessagesException(Exception): + """Raised if a GET on /messages returns with a failed status code.""" + + class CouldNotGetAccountException(Exception): - """Raised if a POST on /accounts or /authorization_token return a failed status code.""" + """Raised if a POST on /accounts or /authorization_token returns with a failed status code.""" class InvalidDbAccountException(Exception): @@ -140,10 +169,13 @@ class MailTm: db_file = os.path.join(Path.home(), ".pymailtm") def _get_domains_list(self): - r = requests.get("{}/domains".format(self.api_address)) - response = r.json() - domains = list(map(lambda x: x["domain"], response["hydra:member"])) - return domains + while True: + r = requests.get("{}/domains".format(self.api_address)) + if r.status_code == 200: + response = r.json() + domains = list(map(lambda x: x["domain"], response["hydra:member"])) + return domains + sleep(2) def get_account(self, password=None): """Create and return a new account.""" @@ -172,7 +204,7 @@ def _make_account_request(endpoint, address, password): r = requests.post("{}/{}".format(MailTm.api_address, endpoint), data=json.dumps(account), headers=headers) if r.status_code not in [200, 201]: - raise CouldNotGetAccountException() + raise CouldNotGetAccountException(f"HTTP {r.status_code}") return r.json() def monitor_new_account(self, force_new=False): diff --git a/pyproject.toml b/pyproject.toml index 7ad74b9..eaf9137 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "pymailtm" -version = "1.1.0" +version = "1.1.1" description = "A python web api wrapper and command line client for mail.tm." license = "GPL-3.0-only" @@ -38,23 +38,23 @@ pymailtm = 'pymailtm.cli:init' [tool.poetry.dependencies] python = "^3.7" -requests = "^2.25.1" +requests = "^2.28.1" random-username = "^1.0.2" pyperclip = "^1.8.2" [tool.poetry.dev-dependencies] -anyio = "^2.2.0" -yagmail = "^0.14.245" -pytest = "^6.2.2" -pytest-cov = "^2.11.1" -pytest-mock = "^3.5.1" -pytest-sugar = "^0.9.4" -pytest-spec = "^3.1.0" -pytest-timeout = "^1.4.2" -coveralls = "^3.0.1" -PyYAML = "^5.4.1" -pytest-recording = "^0.12.0" -pytest-vcr-delete-on-fail = "^0.9.0" +anyio = "^3.6.1" +yagmail = "^0.15.283" +pytest = "^7.1.2" +pytest-cov = "^3.0.0" +pytest-mock = "^3.8.2" +pytest-sugar = "^0.9.5" +pytest-spec = "^3.2.0" +pytest-timeout = "^2.1.0" +coveralls = "^3.3.1" +PyYAML = "^6.0" +pytest-recording = "^0.12.1" +pytest-vcr-delete-on-fail = "^2.0.0" python-dotenv = "^0.20.0" vcrpy-encrypt = "^0.9.1" diff --git a/tests/cassettes/test_pymailtm/TestAMailtmAccount.test_should_be_able_to_delete_itself.yaml.enc b/tests/cassettes/test_pymailtm/TestAMailtmAccount.test_should_be_able_to_delete_itself.yaml.enc index 26f8ee6..07e512d 100644 Binary files a/tests/cassettes/test_pymailtm/TestAMailtmAccount.test_should_be_able_to_delete_itself.yaml.enc and b/tests/cassettes/test_pymailtm/TestAMailtmAccount.test_should_be_able_to_delete_itself.yaml.enc differ diff --git a/tests/cassettes/test_pymailtm/TestAMailtmAccount.test_should_be_able_to_monitor_new_messages.yaml.enc b/tests/cassettes/test_pymailtm/TestAMailtmAccount.test_should_be_able_to_monitor_new_messages.yaml.enc index 83d65bc..34a51ca 100644 Binary files a/tests/cassettes/test_pymailtm/TestAMailtmAccount.test_should_be_able_to_monitor_new_messages.yaml.enc and b/tests/cassettes/test_pymailtm/TestAMailtmAccount.test_should_be_able_to_monitor_new_messages.yaml.enc differ diff --git a/tests/cassettes/test_pymailtm/TestAMailtmAccount.test_should_be_able_to_wait_for_and_return_a_new_message.yaml.enc b/tests/cassettes/test_pymailtm/TestAMailtmAccount.test_should_be_able_to_wait_for_and_return_a_new_message.yaml.enc index ebf2af2..3b94f7f 100644 Binary files a/tests/cassettes/test_pymailtm/TestAMailtmAccount.test_should_be_able_to_wait_for_and_return_a_new_message.yaml.enc and b/tests/cassettes/test_pymailtm/TestAMailtmAccount.test_should_be_able_to_wait_for_and_return_a_new_message.yaml.enc differ diff --git a/tests/cassettes/test_pymailtm/TestAMailtmAccount.test_should_raise_an_exception_if_wrong_credentials_are_used.yaml.enc b/tests/cassettes/test_pymailtm/TestAMailtmAccount.test_should_raise_an_exception_if_wrong_credentials_are_used.yaml.enc index 0246e3c..3b29d20 100644 Binary files a/tests/cassettes/test_pymailtm/TestAMailtmAccount.test_should_raise_an_exception_if_wrong_credentials_are_used.yaml.enc and b/tests/cassettes/test_pymailtm/TestAMailtmAccount.test_should_raise_an_exception_if_wrong_credentials_are_used.yaml.enc differ diff --git a/tests/cassettes/test_pymailtm/TestAMailtmAccount.test_should_recover_the_jwt_when_creating_an_object.yaml.enc b/tests/cassettes/test_pymailtm/TestAMailtmAccount.test_should_recover_the_jwt_when_creating_an_object.yaml.enc index 754e6c8..7efd6c5 100644 Binary files a/tests/cassettes/test_pymailtm/TestAMailtmAccount.test_should_recover_the_jwt_when_creating_an_object.yaml.enc and b/tests/cassettes/test_pymailtm/TestAMailtmAccount.test_should_recover_the_jwt_when_creating_an_object.yaml.enc differ diff --git a/tests/cassettes/test_pymailtm/TestAMailtmAccount.test_should_return_an_empty_list_with_no_message.yaml.enc b/tests/cassettes/test_pymailtm/TestAMailtmAccount.test_should_return_an_empty_list_with_no_message.yaml.enc index bddf0da..1f1a604 100644 Binary files a/tests/cassettes/test_pymailtm/TestAMailtmAccount.test_should_return_an_empty_list_with_no_message.yaml.enc and b/tests/cassettes/test_pymailtm/TestAMailtmAccount.test_should_return_an_empty_list_with_no_message.yaml.enc differ diff --git a/tests/cassettes/test_pymailtm/TestAMailtmAccount.test_should_return_messages_if_present.yaml.enc b/tests/cassettes/test_pymailtm/TestAMailtmAccount.test_should_return_messages_if_present.yaml.enc index e796c61..ee46978 100644 Binary files a/tests/cassettes/test_pymailtm/TestAMailtmAccount.test_should_return_messages_if_present.yaml.enc and b/tests/cassettes/test_pymailtm/TestAMailtmAccount.test_should_return_messages_if_present.yaml.enc differ diff --git a/tests/cassettes/test_pymailtm/TestAMailtmClass.test_has_a_method_to_get_all_domains_available.yaml.enc b/tests/cassettes/test_pymailtm/TestAMailtmClass.test_has_a_method_to_get_all_domains_available.yaml.enc index 49af041..dec8373 100644 Binary files a/tests/cassettes/test_pymailtm/TestAMailtmClass.test_has_a_method_to_get_all_domains_available.yaml.enc and b/tests/cassettes/test_pymailtm/TestAMailtmClass.test_has_a_method_to_get_all_domains_available.yaml.enc differ diff --git a/tests/cassettes/test_pymailtm/TestAMailtmClass.test_has_a_method_to_open_an_account_and_the_browser.yaml.enc b/tests/cassettes/test_pymailtm/TestAMailtmClass.test_has_a_method_to_open_an_account_and_the_browser.yaml.enc index 82d93fd..c10866a 100644 Binary files a/tests/cassettes/test_pymailtm/TestAMailtmClass.test_has_a_method_to_open_an_account_and_the_browser.yaml.enc and b/tests/cassettes/test_pymailtm/TestAMailtmClass.test_has_a_method_to_open_an_account_and_the_browser.yaml.enc differ diff --git a/tests/cassettes/test_pymailtm/TestAMailtmClass.test_has_a_method_to_register_an_account.yaml.enc b/tests/cassettes/test_pymailtm/TestAMailtmClass.test_has_a_method_to_register_an_account.yaml.enc index 7e60e31..140fd4d 100644 Binary files a/tests/cassettes/test_pymailtm/TestAMailtmClass.test_has_a_method_to_register_an_account.yaml.enc and b/tests/cassettes/test_pymailtm/TestAMailtmClass.test_has_a_method_to_register_an_account.yaml.enc differ diff --git a/tests/cassettes/test_pymailtm/TestAMailtmClass.test_should_allow_to_recover_the_token_for_an_existing_account.yaml.enc b/tests/cassettes/test_pymailtm/TestAMailtmClass.test_should_allow_to_recover_the_token_for_an_existing_account.yaml.enc index e51b6e3..84b104f 100644 Binary files a/tests/cassettes/test_pymailtm/TestAMailtmClass.test_should_allow_to_recover_the_token_for_an_existing_account.yaml.enc and b/tests/cassettes/test_pymailtm/TestAMailtmClass.test_should_allow_to_recover_the_token_for_an_existing_account.yaml.enc differ diff --git a/tests/cassettes/test_pymailtm/TestAMailtmClass.test_should_be_able_to_create_and_save_an_account_with_a_custom_password.yaml.enc b/tests/cassettes/test_pymailtm/TestAMailtmClass.test_should_be_able_to_create_and_save_an_account_with_a_custom_password.yaml.enc index 9a92d31..b7ab957 100644 Binary files a/tests/cassettes/test_pymailtm/TestAMailtmClass.test_should_be_able_to_create_and_save_an_account_with_a_custom_password.yaml.enc and b/tests/cassettes/test_pymailtm/TestAMailtmClass.test_should_be_able_to_create_and_save_an_account_with_a_custom_password.yaml.enc differ diff --git a/tests/cassettes/test_pymailtm/TestAMailtmClass.test_should_be_able_to_create_and_save_an_account_without_errors.yaml.enc b/tests/cassettes/test_pymailtm/TestAMailtmClass.test_should_be_able_to_create_and_save_an_account_without_errors.yaml.enc index 59b734f..b601303 100644 Binary files a/tests/cassettes/test_pymailtm/TestAMailtmClass.test_should_be_able_to_create_and_save_an_account_without_errors.yaml.enc and b/tests/cassettes/test_pymailtm/TestAMailtmClass.test_should_be_able_to_create_and_save_an_account_without_errors.yaml.enc differ diff --git a/tests/cassettes/test_pymailtm/TestAMailtmClass.test_should_be_able_to_read_an_account_from_disk.yaml.enc b/tests/cassettes/test_pymailtm/TestAMailtmClass.test_should_be_able_to_read_an_account_from_disk.yaml.enc index 24d1595..8cf71e3 100644 Binary files a/tests/cassettes/test_pymailtm/TestAMailtmClass.test_should_be_able_to_read_an_account_from_disk.yaml.enc and b/tests/cassettes/test_pymailtm/TestAMailtmClass.test_should_be_able_to_read_an_account_from_disk.yaml.enc differ diff --git a/tests/cassettes/test_pymailtm/TestAMailtmClass.test_should_be_able_to_save_an_account_to_disk.yaml.enc b/tests/cassettes/test_pymailtm/TestAMailtmClass.test_should_be_able_to_save_an_account_to_disk.yaml.enc index f675239..5eaf3c9 100644 Binary files a/tests/cassettes/test_pymailtm/TestAMailtmClass.test_should_be_able_to_save_an_account_to_disk.yaml.enc and b/tests/cassettes/test_pymailtm/TestAMailtmClass.test_should_be_able_to_save_an_account_to_disk.yaml.enc differ diff --git a/tests/cassettes/test_pymailtm/TestAMailtmClass.test_should_raise_an_exception_when_trying_to_register_an_account_incorrectly.yaml.enc b/tests/cassettes/test_pymailtm/TestAMailtmClass.test_should_raise_an_exception_when_trying_to_register_an_account_incorrectly.yaml.enc index c98de3d..25255b6 100644 Binary files a/tests/cassettes/test_pymailtm/TestAMailtmClass.test_should_raise_an_exception_when_trying_to_register_an_account_incorrectly.yaml.enc and b/tests/cassettes/test_pymailtm/TestAMailtmClass.test_should_raise_an_exception_when_trying_to_register_an_account_incorrectly.yaml.enc differ diff --git a/tests/cassettes/test_pymailtm/TestWhenMailtmOpensAnAccount.test_it_should_not_crash_because_of_broken_pyperclip.yaml.enc b/tests/cassettes/test_pymailtm/TestWhenMailtmOpensAnAccount.test_it_should_not_crash_because_of_broken_pyperclip.yaml.enc index dbbf106..baffbd6 100644 Binary files a/tests/cassettes/test_pymailtm/TestWhenMailtmOpensAnAccount.test_it_should_not_crash_because_of_broken_pyperclip.yaml.enc and b/tests/cassettes/test_pymailtm/TestWhenMailtmOpensAnAccount.test_it_should_not_crash_because_of_broken_pyperclip.yaml.enc differ diff --git a/tests/cassettes/test_pymailtm/TestWhenMailtmOpensAnAccount.test_should_be_be_able_to_recover_existing_account.yaml.enc b/tests/cassettes/test_pymailtm/TestWhenMailtmOpensAnAccount.test_should_be_be_able_to_recover_existing_account.yaml.enc index d75de1e..a243503 100644 Binary files a/tests/cassettes/test_pymailtm/TestWhenMailtmOpensAnAccount.test_should_be_be_able_to_recover_existing_account.yaml.enc and b/tests/cassettes/test_pymailtm/TestWhenMailtmOpensAnAccount.test_should_be_be_able_to_recover_existing_account.yaml.enc differ diff --git a/tests/cassettes/test_pymailtm/TestWhenMailtmOpensAnAccount.test_should_create_a_new_account_if_required.yaml.enc b/tests/cassettes/test_pymailtm/TestWhenMailtmOpensAnAccount.test_should_create_a_new_account_if_required.yaml.enc index 20ebb45..6814437 100644 Binary files a/tests/cassettes/test_pymailtm/TestWhenMailtmOpensAnAccount.test_should_create_a_new_account_if_required.yaml.enc and b/tests/cassettes/test_pymailtm/TestWhenMailtmOpensAnAccount.test_should_create_a_new_account_if_required.yaml.enc differ diff --git a/tests/cassettes/test_pymailtm/TestWhenMailtmOpensAnAccount.test_should_create_a_new_one_with_no_db_file_present.yaml.enc b/tests/cassettes/test_pymailtm/TestWhenMailtmOpensAnAccount.test_should_create_a_new_one_with_no_db_file_present.yaml.enc index 96c7137..fc05f71 100644 Binary files a/tests/cassettes/test_pymailtm/TestWhenMailtmOpensAnAccount.test_should_create_a_new_one_with_no_db_file_present.yaml.enc and b/tests/cassettes/test_pymailtm/TestWhenMailtmOpensAnAccount.test_should_create_a_new_one_with_no_db_file_present.yaml.enc differ diff --git a/tests/test_pymailtm.py b/tests/test_pymailtm.py index 7eae9d9..4349d7c 100644 --- a/tests/test_pymailtm.py +++ b/tests/test_pymailtm.py @@ -179,7 +179,7 @@ def test_should_return_an_empty_list_with_no_message(self): messages = account.get_messages() assert len(messages) == 0 - @pytest.mark.timeout(15) + @pytest.mark.timeout(20) def test_should_return_messages_if_present(self): """... it should return messages, if present""" account = MailTm().get_account() @@ -193,7 +193,7 @@ def test_should_return_messages_if_present(self): assert message.subject == "subject" assert message.text == "test" - @pytest.mark.timeout(15) + @pytest.mark.timeout(20) def test_should_be_able_to_wait_for_and_return_a_new_message(self): """... it should be able to wait for and return a new message""" account = MailTm().get_account() @@ -215,7 +215,7 @@ def send_from_another_thread(acc: Account) -> None: msg = account.wait_for_message() assert msg.text == "test" - @pytest.mark.timeout(15) + @pytest.mark.timeout(20) def test_should_be_able_to_monitor_new_messages(self, mocker): """... it should be able to monitor new messages""" account = MailTm().get_account() @@ -331,18 +331,19 @@ def crash_on_pyperclip_copy(_): mt._open_account(new=True) -class TestTheOpenWebbrowserUtility(): +class TestTheOpenWebbrowserUtility: """The open webbrowser utility...""" def test_should_call_the_webbrowser_library(self, mocker): """... it should call the webbrowser library""" + # noinspection HttpUrlsUsage url = "http://mail.tm" mocked_open = mocker.patch("pymailtm.pymailtm.webbrowser.open", new=create_autospec(webbrowser.open)) open_webbrowser(url) mocked_open.assert_called_once_with(url) -class TestAMailMessage(): +class TestAMailMessage: """A mail message...""" def test_has_a_method_to_open_itself_in_a_webbrowser(self, mocker):