25 lines
761 B
Python
25 lines
761 B
Python
"""Tests for {{ cookiecutter.package_name }}."""
|
|
|
|
import pytest
|
|
|
|
from {{ cookiecutter.package_name }} import hello
|
|
from {{ cookiecutter.package_name }}.core import process_data, {{ cookiecutter.project_name.replace(' ', '').replace('-', '') }}
|
|
|
|
|
|
def test_hello():
|
|
"""Test hello function."""
|
|
result = hello()
|
|
assert "Hello from {{ cookiecutter.project_name }}" in result
|
|
|
|
|
|
def test_process_data():
|
|
"""Test process_data function."""
|
|
result = process_data("test")
|
|
assert result == "Processed: test"
|
|
|
|
|
|
def test_main_class():
|
|
"""Test main class."""
|
|
instance = {{ cookiecutter.project_name.replace(' ', '').replace('-', '') }}("test")
|
|
result = instance.run()
|
|
assert "Running {{ cookiecutter.project_name }} with test" in result |