Add unit tests for models and services
- Implemented unit tests for the Package model, covering methods such as generateId, findById, findByName, and version management. - Created unit tests for the Repository model, including repository creation, name validation, and retrieval methods. - Added tests for the Session model, focusing on session creation, validation, and invalidation. - Developed unit tests for the User model, ensuring user creation, password hashing, and retrieval methods function correctly. - Implemented AuthService tests, validating login, token refresh, and session management. - Added TokenService tests, covering token creation, validation, and revocation processes.
This commit is contained in:
11
test/fixtures/pypi/demo_package/README.md
vendored
Normal file
11
test/fixtures/pypi/demo_package/README.md
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
# stack-test-demo-package
|
||||
|
||||
Demo package for Stack.Gallery Registry e2e tests.
|
||||
|
||||
## Usage
|
||||
|
||||
```python
|
||||
from demo_package import greet
|
||||
|
||||
print(greet("World")) # Hello, World!
|
||||
```
|
||||
8
test/fixtures/pypi/demo_package/demo_package/__init__.py
vendored
Normal file
8
test/fixtures/pypi/demo_package/demo_package/__init__.py
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
"""Demo package for Stack.Gallery Registry e2e tests."""
|
||||
|
||||
__version__ = "1.0.0"
|
||||
|
||||
|
||||
def greet(name: str) -> str:
|
||||
"""Greet the given name."""
|
||||
return f"Hello, {name}!"
|
||||
23
test/fixtures/pypi/demo_package/pyproject.toml
vendored
Normal file
23
test/fixtures/pypi/demo_package/pyproject.toml
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
[build-system]
|
||||
requires = ["setuptools>=61.0", "wheel"]
|
||||
build-backend = "setuptools.build_meta"
|
||||
|
||||
[project]
|
||||
name = "stack-test-demo-package"
|
||||
version = "1.0.0"
|
||||
description = "Demo package for Stack.Gallery Registry e2e tests"
|
||||
readme = "README.md"
|
||||
requires-python = ">=3.8"
|
||||
license = {text = "MIT"}
|
||||
authors = [
|
||||
{name = "Stack.Gallery Test", email = "test@stack.gallery"}
|
||||
]
|
||||
keywords = ["demo", "test", "stack-gallery"]
|
||||
classifiers = [
|
||||
"Development Status :: 3 - Alpha",
|
||||
"License :: OSI Approved :: MIT License",
|
||||
"Programming Language :: Python :: 3",
|
||||
]
|
||||
|
||||
[tool.setuptools.packages.find]
|
||||
where = ["."]
|
||||
Reference in New Issue
Block a user