New feature: command-line interface

Abierto
#106 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
30/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
python
Área
cli

Línea de trabajo

Start by reading the package entry points and existing Hypothesis strategy tests to see how schema-based generation is exposed. The issue proposes two CLI modes: emit unique JSON instances, or run a script and shrink failing examples. Done means both modes accept the described arguments and produce the specified output and failure behavior.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

It occurs to me that having a jsonschema and wanting to test something is by no means limited to projects using Python, and we can pretty easily provide a useful tool or two. Specifically:

hypothesis json SCHEMA --num=100 --seed=0: write NUM instances conforming to SCHEMA to standard out, one line each. The schema can be provided inline, or as a filename. We use the obvious translation to a test under the hood, no database, and bump up max_examples so that we can ensure every line is unique.

hypothesis json SCHEMA --num=100 --script=test.sh: write each example to testcase.json, execute ./test.sh testcase.json, shrink to minimal failing example as usual. Key database off the schema itself, but not the test script; NUM is the max_examples setting directly for this one. The classic fuzzer interface.

Lenguaje dominante
Python
Estrellas
281
Forks
35
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de python-jsonschema/hypothesis-jsonschema

Todos los issues de python-jsonschema/hypothesis-jsonschema

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.