mirror of
				https://github.com/Bryanthelol/namekoplus
				synced 2025-11-04 10:36:10 +08:00 
			
		
		
		
	chore: update the test files
This commit is contained in:
		@@ -2,10 +2,19 @@
 | 
				
			|||||||
Service unit testing best practice.
 | 
					Service unit testing best practice.
 | 
				
			||||||
"""
 | 
					"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import pytest
 | 
				
			||||||
from nameko.testing.services import worker_factory
 | 
					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.
 | 
					    Test example service.
 | 
				
			||||||
    """
 | 
					    """
 | 
				
			||||||
@@ -16,5 +25,5 @@ def test_example_service():
 | 
				
			|||||||
    service.remote.hello.side_effect = lambda name: "Hello, {}!".format(name)
 | 
					    service.remote.hello.side_effect = lambda name: "Hello, {}!".format(name)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # test remote_hello business logic
 | 
					    # test remote_hello business logic
 | 
				
			||||||
    assert service.remote_hello("Bryant") == "Hello, Bryant!"
 | 
					    assert service.remote_hello(value) == expected
 | 
				
			||||||
    service.remote.hello.assert_called_once_with("Bryant")
 | 
					    service.remote.hello.assert_called_once_with(value)
 | 
				
			||||||
							
								
								
									
										2
									
								
								setup.py
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								setup.py
									
									
									
									
									
								
							@@ -9,7 +9,7 @@ with open(path.join(here, 'README.md'), encoding='utf-8') as f:
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
setup(
 | 
					setup(
 | 
				
			||||||
    name='namekoplus',
 | 
					    name='namekoplus',
 | 
				
			||||||
    version='0.3.0',
 | 
					    version='0.3.1',
 | 
				
			||||||
    description='A lightweight Python distributed microservice solution',
 | 
					    description='A lightweight Python distributed microservice solution',
 | 
				
			||||||
    long_description=long_description,
 | 
					    long_description=long_description,
 | 
				
			||||||
    long_description_content_type='text/markdown',
 | 
					    long_description_content_type='text/markdown',
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user