Preparing for initial release

This commit is contained in:
Jürgen Edelbluth 2023-12-03 10:35:14 +01:00
parent be7290f625
commit c295812918
Signed by: jed
GPG Key ID: 6DEAEDD5CDB646DF
5 changed files with 72 additions and 8 deletions

7
CHANGELOG.md Normal file
View File

@ -0,0 +1,7 @@
# Changelog
## v0.1.0 (2023-12-03) Initial Release
- Initial Release of an alpha version
- Limited features
- First published version to the PyPI

20
LICENSE.txt Normal file
View File

@ -0,0 +1,20 @@
Copyright Juergen Edelbluth and other contributors, https://juergen.rocks/
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@ -1,4 +1,43 @@
# pytest-smtp-test-server
pytest plugin for using `smtp-test-server` as pytest fixtures.
pytest plugin for using [`smtp-test-server`](https://git.codebau.dev/jed/smtp-test-server) as pytest mock fixtures.
## Installation
### Installation with "pip"
```Bash
pip install pytest-smtp-test-server
```
### Installation with "poetry"
```Bash
poetry add --group dev pytest-smtp-test-server
```
## Usage
After installation, one could easily use one of the provided fixtures in your pytest test case:
```Python
def test_mail_sending(smtp_mock):
my_mail_sending_method(host=smtp_mock.host, port=smtp_mock.port)
assert len(smtp_mock.messages) == 1
```
## Scopes
Fixtures are provided for different [pytest fixture scopes](https://docs.pytest.org/en/stable/explanation/fixtures.html)
for your convenience:
| fixture name | pytest fixture scope |
|-----------------------|----------------------|
| `smtp_mock` | function |
| `class_smtp_mock` | class |
| `module_smtp_mock` | module |
| `package_smtp_mock` | package |
| `session_smtp_mock` | session |
If you require more control over hosts and ports, consider using
[`smtp-test-server`](https://git.codebau.dev/jed/smtp-test-server) directly.

9
poetry.lock generated
View File

@ -470,16 +470,13 @@ description = "Simple SMTP test server for running unit and integration tests."
optional = false
python-versions = ">=3.11,<4.0"
files = [
{file = "smtp_test_server-0.1.0.tar.gz", hash = "sha256:758a64a6edf51ebae9ed16ed6bccf00864941629f3aadb761d7de70d13016aed"},
{file = "smtp_test_server-0.1.0-py3-none-any.whl", hash = "sha256:d19387bf1e7f53b0c1ceedb9e8dd6147d0189bae93ccd90145c278c6a97919c6"},
{file = "smtp_test_server-0.1.0.tar.gz", hash = "sha256:b64ee81af6cb2a44031ce2b9f885faeeb76f088d9c7bcfcee4d11751ea5d9aa6"},
]
[package.dependencies]
aiosmtpd = ">=1.4.4.post2,<2.0.0"
[package.source]
type = "file"
url = "../smtp-test-server/dist/smtp_test_server-0.1.0.tar.gz"
[[package]]
name = "termcolor"
version = "2.3.0"
@ -519,4 +516,4 @@ files = [
[metadata]
lock-version = "2.0"
python-versions = "^3.11"
content-hash = "d7fdce0120ee82b9f1314ecdd7df0bc8d9e7dbffd070acadf3681efc41b67357"
content-hash = "670588463f4e7f3ecb2ab360630be95c9b9d877420062f93c4dab0142d6348ed"

View File

@ -34,6 +34,7 @@ classifiers = [
"Wiki" = "https://git.codebau.dev/pytest-plugins/pytest-smtp-test-server/wiki"
"Releases" = "https://git.codebau.dev/pytest-plugins/pytest-smtp-test-server/releases"
"Documentation" = "https://git.codebau.dev/pytest-plugins/pytest-smtp-test-server/"
"Changelog" = "https://git.codebau.dev/pytest-plugins/pytest-smtp-test-server/CHANGELOG.md"
[tool.poetry.plugins."pytest11"]
"pytest-mail-mock" = "pytest_smtp_test_server.plugin"
@ -84,7 +85,7 @@ multi_line_output = 3
[tool.poetry.dependencies]
python = "^3.11"
pytest = "^7.4.3"
smtp-test-server = {path = "../smtp-test-server/dist/smtp_test_server-0.1.0.tar.gz"}
smtp-test-server = "^0.1.0"
[build-system]
requires = ["poetry-core"]