Test case generator. Quickly design and generate test cases without all the bulk
Project description
tcgen
Yet another test case generator (But hopefully better)
Quickly and painlessly generate testcases with a minimal amount of code
Installation
python3.7 -m pip install cp-tcgen
Capabilities
tcgen creates several endpoints to generate data with several different methods
Primitives
Primitive
Integer
Bool
Float
Char
Prime
Datatypes
Array
String
NonDecreasing
StrictlyIncreasing
Permutation
Graph
Tree
LineGraph
Grid
DAG
StarGraph
KRegularTree
Examples
from tcgen import *
# Bounds are 1..1e5 by default
N = Integer(2, 100000)
print(N)
print(Array(N, Integer(10000)))
from tcgen import *
class Gen(Generator):
def generate(self, case_num):
N = Integer(L=2, wcnt=20) # Weighted random
K = Integer(100)
self.p(N, K)
self.p(Array(N, U=10000))
gen = Gen()
print(gen.get_test_cases(10))
print(gen.get_test_case())
from tcgen import *
A, B = Integer(), Integer()
print(A, B)
# 1 <= N <= A+B
N = Integer(A + B)
print(N)
from tcgen import *
N = Integer()
print(N)
M = Integer(2 * N)
print(M)
print(Graph(N, M).shuffle())
from tcgen import *
N = Integer()
print(N)
print(StrictlyIncreasing(N).shuffle())
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
cp-tcgen-0.11.1.tar.gz
(11.1 kB
view hashes)
Built Distribution
cp_tcgen-0.11.1-py3-none-any.whl
(13.6 kB
view hashes)
Close
Hashes for cp_tcgen-0.11.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b69738282fe8622082a22a3310c9305a58b56a121866b8ba90b39c031cb35dc7 |
|
MD5 | 36b57a8eee381add3c6aa63c7c9a9fea |
|
BLAKE2b-256 | 17bfab3a703718454ec681e995e433a70b2b4ef1967e9ab133b43fbd83f776d1 |