Initial upload: ConfigConvert CLI with full test suite and CI/CD
Some checks failed
CI / test (push) Has been cancelled
CI / lint (push) Has been cancelled

This commit is contained in:
2026-02-04 07:05:29 +00:00
parent d8d254830d
commit f72529ec2e

84
tests/conftest.py Normal file
View File

@@ -0,0 +1,84 @@
"""Pytest configuration and fixtures."""
import pytest
import tempfile
import os
from pathlib import Path
@pytest.fixture
def sample_json():
return {
"name": "test-project",
"version": "1.0.0",
"debug": True,
"database": {
"host": "localhost",
"port": 5432,
"ssl": False
},
"tags": ["python", "cli"]
}
@pytest.fixture
def sample_yaml():
return """name: test-project
version: '1.0.0'
debug: true
database:
host: localhost
port: 5432
ssl: false
tags:
- python
- cli
"""
@pytest.fixture
def sample_toml():
return """name = "test-project"
version = "1.0.0"
debug = true
[database]
host = "localhost"
port = 5432
ssl = false
tags = ["python", "cli"]
"""
@pytest.fixture
def sample_env():
return """NAME=test-project
VERSION=1.0.0
DEBUG=true
DATABASE_HOST=localhost
DATABASE_PORT=5432
DATABASE_SSL=false
TAGS=python,cli
"""
@pytest.fixture
def temp_file():
def _create_temp_file(content="", suffix=".txt"):
fd, path = tempfile.mkstemp(suffix=suffix)
os.write(fd, content.encode())
os.close(fd)
yield path
os.unlink(path)
return _create_temp_file
@pytest.fixture
def temp_dir():
def _create_temp_dir():
path = tempfile.mkdtemp()
yield path
import shutil
shutil.rmtree(path)
return _create_temp_dir