2 Commits

Author SHA1 Message Date
58a99d9d2c chore: bump python-on-whales to 0.63.0 2023-07-25 17:37:21 +08:00
0777788609 chore: update the test files 2023-07-24 18:02:22 +08:00
2 changed files with 14 additions and 5 deletions

View File

@@ -2,10 +2,19 @@
Service unit testing best practice.
"""
import pytest
from nameko.testing.services import worker_factory
def test_example_service():
@pytest.mark.parametrize(
'value, expected',
[
('John Doe', 'Hello, John Doe!'),
('', 'Hello, !'),
('Bryant', 'Hello, Bryant!'),
],
)
def test_example_service(value, expected):
"""
Test example service.
"""
@@ -16,5 +25,5 @@ def test_example_service():
service.remote.hello.side_effect = lambda name: "Hello, {}!".format(name)
# test remote_hello business logic
assert service.remote_hello("Bryant") == "Hello, Bryant!"
service.remote.hello.assert_called_once_with("Bryant")
assert service.remote_hello(value) == expected
service.remote.hello.assert_called_once_with(value)

View File

@@ -9,7 +9,7 @@ with open(path.join(here, 'README.md'), encoding='utf-8') as f:
setup(
name='namekoplus',
version='0.3.0',
version='0.3.2',
description='A lightweight Python distributed microservice solution',
long_description=long_description,
long_description_content_type='text/markdown',
@@ -50,7 +50,7 @@ setup(
install_requires=[
'nameko==3.0.0rc11',
'click==8.1.5',
'python-on-whales==0.62.0',
'python-on-whales==0.63.0',
'pytest==7.4.0'
],
extras_require={