merge: integrate ticket 26 image publishing
This commit is contained in:
14
backend/.dockerignore
Normal file
14
backend/.dockerignore
Normal file
@ -0,0 +1,14 @@
|
||||
# Keep credentials and host artifacts out of the build context.
|
||||
.env
|
||||
.env.*
|
||||
**/.env
|
||||
**/.env.*
|
||||
.git
|
||||
.aws
|
||||
.claude
|
||||
**/*.pem
|
||||
**/*.key
|
||||
node_modules
|
||||
dist
|
||||
coverage
|
||||
__pycache__
|
||||
@ -2,6 +2,7 @@ package server
|
||||
|
||||
import (
|
||||
"os"
|
||||
"reflect"
|
||||
"testing"
|
||||
|
||||
"gopkg.in/yaml.v3"
|
||||
@ -46,31 +47,55 @@ func TestStandardComposeRunsLayaOnCPUAndKeepsOllamaOptional(t *testing.T) {
|
||||
})
|
||||
}
|
||||
|
||||
func TestProductionComposeBuildsBackendFromCurrentLocalCode(t *testing.T) {
|
||||
data, err := os.ReadFile("../../../docker-compose.prod.yml")
|
||||
func TestProductionComposeUsesPublishedImagesAndPreservesRuntime(t *testing.T) {
|
||||
read := func(path string) map[string]any {
|
||||
t.Helper()
|
||||
data, err := os.ReadFile(path)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
var compose struct {
|
||||
Services map[string]struct {
|
||||
Image string `yaml:"image"`
|
||||
Build *struct {
|
||||
Context string `yaml:"context"`
|
||||
Dockerfile string `yaml:"dockerfile"`
|
||||
} `yaml:"build"`
|
||||
} `yaml:"services"`
|
||||
var document map[string]any
|
||||
if err := yaml.Unmarshal(data, &document); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if err := yaml.Unmarshal(data, &compose); err != nil {
|
||||
t.Fatalf("parse docker-compose.prod.yml: %v", err)
|
||||
return document
|
||||
}
|
||||
backend, ok := compose.Services["backend"]
|
||||
if !ok {
|
||||
t.Fatal("production Compose has no backend service")
|
||||
standard := read("../../../docker-compose.yml")
|
||||
production := read("../../../docker-compose.prod.yml")
|
||||
services := production["services"].(map[string]any)
|
||||
names := map[string]string{"backend": "backend", "frontend": "frontend", "scraper": "scraper", "laya": "laya"}
|
||||
for name, raw := range services {
|
||||
service := raw.(map[string]any)
|
||||
if _, exists := service["build"]; exists {
|
||||
t.Errorf("%s still builds", name)
|
||||
}
|
||||
if backend.Build == nil || backend.Build.Context != "./backend" {
|
||||
t.Errorf("backend build=%+v; want an image built from local ./backend source", backend.Build)
|
||||
if service["pull_policy"] == "build" {
|
||||
t.Errorf("%s has build pull policy", name)
|
||||
}
|
||||
if backend.Image == "gitea.anthonybouteiller.ovh/blomios/tradarr-backend:v1.1.0" {
|
||||
t.Errorf("backend still pins historical v1.1.0 image instead of current ticket code")
|
||||
if suffix, ok := names[name]; ok {
|
||||
want := "gitea.anthonybouteiller.ovh/blomios/tradarr-" + suffix + ":e46108fecc6f076a3d5d8bf4e7d1e7539ea3b37f"
|
||||
if service["image"] != want {
|
||||
t.Errorf("%s image=%v", name, service["image"])
|
||||
}
|
||||
}
|
||||
original := standard["services"].(map[string]any)[name].(map[string]any)
|
||||
delete(original, "build")
|
||||
delete(original, "pull_policy")
|
||||
if _, ok := names[name]; ok {
|
||||
delete(original, "image")
|
||||
delete(service, "image")
|
||||
}
|
||||
if name == "backend" {
|
||||
if service["stop_grace_period"] != "5m" {
|
||||
t.Error("production shutdown grace lost")
|
||||
}
|
||||
delete(service, "stop_grace_period")
|
||||
}
|
||||
if !reflect.DeepEqual(original, service) {
|
||||
t.Errorf("%s runtime differs from standard Compose", name)
|
||||
}
|
||||
}
|
||||
if !reflect.DeepEqual(standard["volumes"], production["volumes"]) {
|
||||
t.Error("volumes differ")
|
||||
}
|
||||
}
|
||||
|
||||
@ -21,7 +21,7 @@ services:
|
||||
- "8191"
|
||||
|
||||
scraper:
|
||||
image: gitea.anthonybouteiller.ovh/blomios/tradarr-scraper:v1.1.0
|
||||
image: gitea.anthonybouteiller.ovh/blomios/tradarr-scraper:e46108fecc6f076a3d5d8bf4e7d1e7539ea3b37f
|
||||
restart: unless-stopped
|
||||
depends_on:
|
||||
- byparr
|
||||
@ -31,11 +31,9 @@ services:
|
||||
- "3001"
|
||||
|
||||
backend:
|
||||
build:
|
||||
context: ./backend
|
||||
dockerfile: Dockerfile
|
||||
restart: unless-stopped
|
||||
stop_grace_period: 5m
|
||||
image: gitea.anthonybouteiller.ovh/blomios/tradarr-backend:e46108fecc6f076a3d5d8bf4e7d1e7539ea3b37f
|
||||
restart: unless-stopped
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
@ -62,13 +60,7 @@ services:
|
||||
- "8080"
|
||||
|
||||
laya:
|
||||
image: tradarr-laya:v0.5.2-cpu
|
||||
pull_policy: build
|
||||
build:
|
||||
# Official v0.5.2 annotated tag dereferenced to its immutable commit.
|
||||
context: https://github.com/NandhaKishorM/laya.git#e150aa92a0d4059ac621875b39b620847cf1b88a
|
||||
args:
|
||||
TORCH_INDEX: cpu
|
||||
image: gitea.anthonybouteiller.ovh/blomios/tradarr-laya:e46108fecc6f076a3d5d8bf4e7d1e7539ea3b37f
|
||||
command: ["laya-serve"]
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
@ -99,7 +91,7 @@ services:
|
||||
- ollama_data:/root/.ollama
|
||||
|
||||
frontend:
|
||||
image: gitea.anthonybouteiller.ovh/blomios/tradarr-frontend:v1.1.0
|
||||
image: gitea.anthonybouteiller.ovh/blomios/tradarr-frontend:e46108fecc6f076a3d5d8bf4e7d1e7539ea3b37f
|
||||
restart: unless-stopped
|
||||
depends_on:
|
||||
- backend
|
||||
|
||||
@ -23,7 +23,32 @@ Compose consomme aussi `POSTGRES_DB`/`POSTGRES_USER` (défaut `tradarr`), `POSTG
|
||||
|
||||
Pour le développement hôte, exporter les variables backend dans le terminal. Le serveur ne charge pas de fichier dotenv. Lancer `make dev-backend` depuis la racine garantit le chemin relatif des migrations. Un PostgreSQL hôte doit être fourni séparément : le Compose existant ne publie pas son port 5432.
|
||||
|
||||
Le fichier `docker-compose.prod.yml` construit le backend à partir du code local actuel (`context: ./backend`, `Dockerfile`). `docker compose -f docker-compose.prod.yml build backend` construit seulement cette image, sans démarrer les services ni publier d’image. Le frontend et le service de récupération conservent leurs images préconstruites `v1.1.0` ; la récupération reste inchangée. Aucune image n’est publiée par ce workflow. Les deux Compose contiennent un montage absolu `/home/anthony/.claude:/root/.claude`, non portable et lié au fournisseur Claude Code. Examiner sa pertinence pour l’installation, sans partager de credentials. Les services de récupération et leur configuration héritée restent hors périmètre de cette documentation ; ne pas ajouter de contournement ni modifier leur extraction.
|
||||
Le fichier `docker-compose.prod.yml` consomme quatre images publiées sous `gitea.anthonybouteiller.ovh/blomios/tradarr-{backend,frontend,scraper,laya}`. Le tag publié `e46108fecc6f076a3d5d8bf4e7d1e7539ea3b37f` est épinglé dans les quatre références, sans variable `TRADARR_IMAGE_TAG` ; aucun build ne s’exécute côté serveur. PostgreSQL, Byparr et Ollama restent tiers. Le montage `/home/anthony/.claude:/root/.claude` et le délai d’arrêt backend de cinq minutes sont conservés.
|
||||
|
||||
### Construction et publication
|
||||
|
||||
Depuis la racine, avec Bash, Git et Docker/BuildKit disponibles :
|
||||
|
||||
```sh
|
||||
./scripts/publish-images.sh --dry-run
|
||||
./scripts/publish-images.sh --tag v1.2.0 --dry-run
|
||||
# Après authentification séparée : construit puis pousse les quatre images
|
||||
./scripts/publish-images.sh
|
||||
```
|
||||
|
||||
Sans `--dry-run`, le script construit puis pousse automatiquement les quatre images ; `--push` reste accepté pour compatibilité mais est inutile. Sans `--tag`, le SHA Git HEAD complet est utilisé, jamais `latest`. Utiliser un checkout propre validé par Git : le script construit les fichiers présents, et ne vérifie pas leur propreté. Les quatre builds doivent réussir avant le premier push. Un échec de push peut laisser une publication partielle : ne déployer qu’après succès complet. `--dry-run` lit seulement HEAD et affiche le plan, sans appel Docker, build, téléchargement ni push. Les labels OCI source/revision/version identifient Tradarr et, pour Laya, son dépôt amont et son commit épinglé. Le tag commun reste la version de livraison Tradarr.
|
||||
|
||||
Authentifier séparément l’opérateur avec `docker login gitea.anthonybouteiller.ovh` (saisie interactive du jeton, ou `--password-stdin` via un gestionnaire de secrets). Configurer Docker avec un credential helper et les droits de publication nécessaires. Ne jamais fournir de secret dans le tag, la commande, les labels ou le dépôt. Le script ne lit ni ne journalise les credentials ; la sortie Docker est masquée pour éviter d’exposer des diagnostics sensibles. Les `.dockerignore` excluent dotenv, clés et répertoires de credentials courants ; aucun secret ne doit être placé dans les sources copiées dans une image.
|
||||
|
||||
Sur le serveur, authentifier Docker séparément avec accès en lecture, puis définir les variables applicatives obligatoires décrites plus haut. Les images du tag épinglé existent déjà ; aucune nouvelle publication n’est nécessaire pour ce déploiement :
|
||||
|
||||
```sh
|
||||
docker compose -f docker-compose.prod.yml config --quiet
|
||||
docker compose -f docker-compose.prod.yml pull
|
||||
docker compose -f docker-compose.prod.yml up -d --no-build
|
||||
```
|
||||
|
||||
Ne pas combiner les deux fichiers Compose : la production s’utilise seule. Pour revenir à une version publiée, modifier ensemble les quatre références du Compose pour utiliser son tag puis relancer pull/up sans supprimer de volume. Cette opération ne remplace pas une stratégie de restauration des migrations/données. Aucun mécanisme d’extraction du récupérateur n’est modifié.
|
||||
|
||||
## Premier compte et administration
|
||||
|
||||
@ -37,7 +62,7 @@ Laya utilise le [serveur officiel v0.5.2](https://github.com/NandhaKishorM/laya/
|
||||
|
||||
Variables backend : `LAYA_URL` (défaut `http://laya:8000`), `LAYA_TIMEOUT` (défaut `120s`, durée positive ≤10 minutes) et `LAYA_API_KEY` (optionnelle, bearer partagé avec le service). Lors d’un échec, un log applicatif indique la cause assainie (`HTTP status 503`, `timeout`, réponse invalide, etc.). Aucun corps de réponse, prompt, article, URL fournisseur ou secret n’est journalisé par cet adapter. Le timeout couvre tous les lots d’un appel. `title_content` indique explicitement `content_fallback=title_only` si le contenu manque ; aucun contenu n’est récupéré ou fabriqué.
|
||||
|
||||
Compose standard et production construisent le Dockerfile officiel CPU à ce commit, préchargent uniquement `multilingual` (`LAYA_MODELS`, `LAYA_PRELOAD=1`) et utilisent les révisions de poids épinglées fournies par la release (`LAYA_REVISION=reviewed`). `laya_model_cache` conserve les poids ; ne pas supprimer ce volume pour une simple relance. `LAYA_THREADS` (Compose, défaut 4) limite les threads CPU. Le healthcheck authentifié contrôle CPU et checkpoint résident. Laya reste sur le réseau interne. Le premier démarrage nécessite un accès au registre de paquets et au fournisseur de poids ; aucun modèle n’a été lancé pendant les tests backend. La construction distante requiert le réseau et Docker/BuildKit. Le Compose production construit désormais le backend local contenant cet adapter ; aucun tag distant n’est créé ou publié.
|
||||
Le Compose standard et le script de publication construisent le Dockerfile officiel CPU à ce commit. Les deux Compose préchargent uniquement `multilingual` (`LAYA_MODELS`, `LAYA_PRELOAD=1`) et utilisent les révisions de poids épinglées fournies par la release (`LAYA_REVISION=reviewed`). `laya_model_cache` conserve les poids ; ne pas supprimer ce volume pour une simple relance. `LAYA_THREADS` (Compose, défaut 4) limite les threads CPU. Le healthcheck authentifié contrôle CPU et checkpoint résident. Laya reste sur le réseau interne. Le premier démarrage nécessite un accès au registre de paquets et au fournisseur de poids ; aucun modèle n’a été lancé pendant les tests backend. La construction distante requiert le réseau et Docker/BuildKit. Le Compose production utilise les images du tag publié épinglé dans ses quatre références.
|
||||
|
||||
Configurer les connexions fournisseurs puis les paires provider/modèle dans le catalogue admin `/api/admin/ai-models`. Chaque utilisateur choisit un `summary_model_id` dans ses préférences, via la liste sans secrets `/api/me/summary-models`. Les comptes créés après migration n’ont aucun choix par défaut. Les anciens réglages `ai_role_*`, provider.model et is_active sont conservés, mais ne sélectionnent plus le modèle de génération. Les endpoints legacy summary-role restent compatibles pour stockage uniquement ; filter/report sont refusés. Aucun rôle/provider Q&A n’est appelé.
|
||||
|
||||
|
||||
14
frontend/.dockerignore
Normal file
14
frontend/.dockerignore
Normal file
@ -0,0 +1,14 @@
|
||||
# Keep credentials and host artifacts out of the build context.
|
||||
.env
|
||||
.env.*
|
||||
**/.env
|
||||
**/.env.*
|
||||
.git
|
||||
.aws
|
||||
.claude
|
||||
**/*.pem
|
||||
**/*.key
|
||||
node_modules
|
||||
dist
|
||||
coverage
|
||||
__pycache__
|
||||
14
scraper-service/.dockerignore
Normal file
14
scraper-service/.dockerignore
Normal file
@ -0,0 +1,14 @@
|
||||
# Keep credentials and host artifacts out of the build context.
|
||||
.env
|
||||
.env.*
|
||||
**/.env
|
||||
**/.env.*
|
||||
.git
|
||||
.aws
|
||||
.claude
|
||||
**/*.pem
|
||||
**/*.key
|
||||
node_modules
|
||||
dist
|
||||
coverage
|
||||
__pycache__
|
||||
87
scripts/publish-images.sh
Executable file
87
scripts/publish-images.sh
Executable file
@ -0,0 +1,87 @@
|
||||
#!/usr/bin/env bash
|
||||
# Build all four images before publication. Authentication stays in Docker.
|
||||
# Disable tracing even when invoked with bash -x: command output may contain secrets.
|
||||
set +x
|
||||
set -euo pipefail
|
||||
|
||||
usage() {
|
||||
cat <<'HELP'
|
||||
Usage: publish-images.sh [--tag TAG] [--dry-run]
|
||||
--tag TAG Image tag (default: full Git HEAD SHA)
|
||||
--dry-run Print the plan without executing Docker
|
||||
Builds and pushes all four images by default.
|
||||
--push Accepted for compatibility; publication is already the default.
|
||||
-h, --help Show this help
|
||||
HELP
|
||||
}
|
||||
fail() { printf '%s\n' "$1" >&2; exit 1; }
|
||||
|
||||
tag=''
|
||||
tag_set=false
|
||||
dry_run=false
|
||||
while (($#)); do
|
||||
case "$1" in
|
||||
--tag)
|
||||
(($# >= 2)) || fail 'Missing value for --tag'
|
||||
tag=$2
|
||||
tag_set=true
|
||||
shift 2
|
||||
;;
|
||||
--dry-run) dry_run=true; shift ;;
|
||||
--push) shift ;;
|
||||
-h|--help) usage; exit 0 ;;
|
||||
*) fail 'Unknown argument; use --help' ;;
|
||||
esac
|
||||
done
|
||||
# ASCII Docker tag syntax; never echo rejected input.
|
||||
export LC_ALL=C
|
||||
if "$tag_set"; then
|
||||
[[ $tag =~ ^[a-zA-Z0-9_][a-zA-Z0-9_.-]{0,127}$ ]] || fail 'Invalid image tag'
|
||||
fi
|
||||
root=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd -P)
|
||||
cd -- "$root"
|
||||
# Read-only runtime lookup; no mutation or remote Git operation.
|
||||
revision=$(git rev-parse --verify HEAD 2>/dev/null) || fail 'Cannot resolve Git HEAD'
|
||||
[[ $revision =~ ^[0-9a-f]{40}$ ]] || fail 'Expected a full Git SHA-1 revision'
|
||||
if ! "$tag_set"; then tag=$revision; fi
|
||||
readonly registry='gitea.anthonybouteiller.ovh/blomios'
|
||||
readonly source='https://gitea.anthonybouteiller.ovh/blomios/Tradarr'
|
||||
readonly laya_revision='e150aa92a0d4059ac621875b39b620847cf1b88a'
|
||||
images=()
|
||||
|
||||
run() {
|
||||
if "$dry_run"; then
|
||||
printf '%q ' "$@"
|
||||
printf '\n'
|
||||
else
|
||||
# Suppress Docker diagnostics; do not expose commands or credentials on failure.
|
||||
"$@" >/dev/null 2>&1 || fail 'Image operation failed; stopped without further publication.'
|
||||
fi
|
||||
}
|
||||
for name in backend frontend scraper laya; do
|
||||
image="$registry/tradarr-$name:$tag"
|
||||
images+=("$image")
|
||||
image_source=$source
|
||||
image_revision=$revision
|
||||
context="$root/$name"
|
||||
extra=()
|
||||
case "$name" in
|
||||
scraper) context="$root/scraper-service" ;;
|
||||
laya)
|
||||
image_source='https://github.com/NandhaKishorM/laya'
|
||||
image_revision=$laya_revision
|
||||
context="$image_source.git#$laya_revision"
|
||||
extra=(--build-arg TORCH_INDEX=cpu)
|
||||
;;
|
||||
esac
|
||||
run docker build --tag "$image" \
|
||||
--label "org.opencontainers.image.source=$image_source" \
|
||||
--label "org.opencontainers.image.revision=$image_revision" \
|
||||
--label "org.opencontainers.image.version=$tag" \
|
||||
"${extra[@]}" "$context"
|
||||
if ! "$dry_run"; then printf 'build completed: %s\n' "$image"; fi
|
||||
done
|
||||
for image in "${images[@]}"; do
|
||||
run docker push "$image"
|
||||
if ! "$dry_run"; then printf 'push completed: %s\n' "$image"; fi
|
||||
done
|
||||
89
scripts/test_publish_images.py
Normal file
89
scripts/test_publish_images.py
Normal file
@ -0,0 +1,89 @@
|
||||
"""Exercise the shell CLI using local fake executables, never real Git/Docker."""
|
||||
import json
|
||||
import os
|
||||
import pathlib
|
||||
import subprocess
|
||||
import tempfile
|
||||
import unittest
|
||||
|
||||
SCRIPT = pathlib.Path(__file__).with_name('publish-images.sh').resolve()
|
||||
SHA = 'a' * 40
|
||||
PIN = 'e150aa92a0d4059ac621875b39b620847cf1b88a'
|
||||
PREFIX = 'gitea.anthonybouteiller.ovh/blomios/tradarr-'
|
||||
|
||||
|
||||
class PublishTests(unittest.TestCase):
|
||||
def invoke(self, args, fail='', sha=SHA):
|
||||
with tempfile.TemporaryDirectory(prefix='publish tests ') as directory:
|
||||
root = pathlib.Path(directory)
|
||||
log = root / 'calls'
|
||||
for name in ['git', 'docker']:
|
||||
executable = root / name
|
||||
executable.write_text('''#!/usr/bin/env python3
|
||||
import json, os, sys
|
||||
with open(os.environ['CALL_LOG'], 'a') as stream:
|
||||
stream.write(json.dumps([os.path.basename(sys.argv[0])] + sys.argv[1:]) + '\\n')
|
||||
if os.path.basename(sys.argv[0]) == 'git':
|
||||
print(os.environ['FAKE_SHA'])
|
||||
else:
|
||||
print('SECRET_FROM_DOCKER', file=sys.stderr)
|
||||
if os.environ['FAIL'] and os.environ['FAIL'] in sys.argv:
|
||||
sys.exit(1)
|
||||
''')
|
||||
executable.chmod(0o755)
|
||||
env = dict(os.environ, PATH=str(root) + os.pathsep + os.environ['PATH'],
|
||||
CALL_LOG=str(log), FAKE_SHA=sha, FAIL=fail)
|
||||
result = subprocess.run(['bash', str(SCRIPT), *args], cwd=root,
|
||||
env=env, capture_output=True, text=True)
|
||||
calls = [json.loads(line) for line in log.read_text().splitlines()] if log.exists() else []
|
||||
self.assertNotIn('SECRET_FROM_DOCKER', result.stdout + result.stderr)
|
||||
return result, calls
|
||||
|
||||
def test_publication_contract(self):
|
||||
for args, builds, pushes in [([], 4, 4), (['--push'], 4, 4),
|
||||
(['--dry-run'], 0, 0), (['--dry-run', '--push'], 0, 0)]:
|
||||
with self.subTest(args=args):
|
||||
result, calls = self.invoke(args)
|
||||
self.assertEqual(result.returncode, 0, result.stderr)
|
||||
docker = [c for c in calls if c[0] == 'docker']
|
||||
if '--dry-run' in args:
|
||||
self.assertEqual(result.stdout.count('docker push '), 4)
|
||||
self.assertEqual([c[1] for c in docker], ['build'] * builds + ['push'] * pushes)
|
||||
for i, name in enumerate(['backend', 'frontend', 'scraper', 'laya']):
|
||||
self.assertIn(PREFIX + name + ':' + SHA, result.stdout)
|
||||
if builds:
|
||||
command = docker[i]
|
||||
revision = PIN if name == 'laya' else SHA
|
||||
self.assertIn('org.opencontainers.image.revision=' + revision, command)
|
||||
self.assertIn('org.opencontainers.image.version=' + SHA, command)
|
||||
self.assertTrue(any(a.startswith('org.opencontainers.image.source=https://') for a in command))
|
||||
if builds:
|
||||
self.assertIn('TORCH_INDEX=cpu', docker[3])
|
||||
self.assertEqual(docker[3][-1], 'https://github.com/NandhaKishorM/laya.git#' + PIN)
|
||||
|
||||
def test_failures_stop_publication(self):
|
||||
for failure, count in [('build', 1), ('push', 5)]:
|
||||
result, calls = self.invoke(['--tag', 'v2'], fail=failure)
|
||||
self.assertNotEqual(result.returncode, 0)
|
||||
docker = [c for c in calls if c[0] == 'docker']
|
||||
self.assertEqual(len(docker), count)
|
||||
self.assertIn(PREFIX + 'backend:v2', docker[0])
|
||||
|
||||
def test_bad_arguments_rejected_before_commands(self):
|
||||
for args in [['--tag', tag] for tag in ['', 'bad/tag', 'secret=value', '-bad', 'x' * 129, '$(touch bad)', 'a\nb']] + [['--tag'], ['--unknown'], ['extra']]:
|
||||
with self.subTest(args=args):
|
||||
result, calls = self.invoke(args)
|
||||
self.assertNotEqual(result.returncode, 0)
|
||||
self.assertEqual(calls, [])
|
||||
|
||||
def test_bad_revision_and_help(self):
|
||||
result, calls = self.invoke([], sha='short')
|
||||
self.assertNotEqual(result.returncode, 0)
|
||||
self.assertEqual(len(calls), 1)
|
||||
result, calls = self.invoke(['--help'])
|
||||
self.assertEqual(result.returncode, 0)
|
||||
self.assertEqual(calls, [])
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
Reference in New Issue
Block a user