Testa
Testa is the best, simple Test tool "CrossPlatform" and "CrossLanguages" (Only Script languages supported for now), develop by developpers for developpers based on comments in your code. The power in this tool is that the grammar is the same for all your implementation languages.
Note: This project is completly experimental, am still working on it, not sure where am going with it lol.
Features
- Testa can do any Unittest you want from an assertion.
- Testa Can Save Your Tests reports so that you can check it later in a persistant file.
- Testa is light and simple because it is based on comments in your code.
- Testa have a specific and very simple grammar for testing "all methods" presents in a file in one time and generate reports.
- Testa is build from scratch so it doesn't have any dependency or any kind of troubleshooting with potentials externals libs.
- Testa can generate for you a small and readable documentation whatever the language you're using
Testa can test all theese programming languages
List of languages, where you can perform testa test:
- [Done] Python
- [Done] Javascript
- [Done] PHP
- [Done] Ruby
Documentation
Some few things to know before using testa.
How to config it
Config files
You need to config a testa.json.
- An example of testa config file for
Javascript:
{
"module": "ta-js",
"path": ["./square.js", "./my_javascript_app/"],
"extensions": [".js"],
"launcher": "node"
}
ps : in path parameter, you can define either a file or a directory
- An example of testa config file for
PHP:
{
"module": "ta-php",
"path": ["./square.php"],
"extensions": [".php"],
"launcher": "php"
}
- An example of testa config file for
python:
{
"module": "ta-py",
"path": ["./sha256.py", "./square.py"],
"extensions": [".py"],
"launcher": "python"
}
- An example of testa config file for
Ruby:
{
"module": "ta-rb",
"path": ["./my_ruby_app/", "./square.rb"],
"extensions": [".rb"],
"launcher": "ruby"
}
Legend
| Parameter | Example | Meaning |
|---|---|---|
| path | ["./javascript/square.js", "./javascript/my_javascript_app/"] | All path where testa will perform tests. |
| extensions | [".js"] | All file extensions to be tests. |
| launcher | "node" | The program responsible fo launching the script in command line. |
| outputMethod | "console.log" | The default print/log for the appropriate language. |
| commentStartBy | "//" | The default started comment character. |
| tryCatch | "try{ \n\t **** \n}catch(err){ \n\t console.log(es);}" | A oneline try catch to get errors when the code crash, the **** will be were the code will be place. |
| function | "" | The function name synthax like function or def. |
| varDeclaration | ["var", "let", "const"] | The prefix on instantiation of a variable. |
| classInstantiationNew | "new" | The keyword synthax instantiation. |
| AccoladeStart | "{" | This define the start of a function or a class. |
| AccoladeEnd | "}" | This define the end of a method or a class. |
| NoneNull | "none" | None for python and null for javascript. |
| selfOrThis | "this" | self for python and this for javascript for example. |
| selfOnFunctionParams | false | The 'self' or 'this' parameter present on method. |
| semicolon | ";" | For thoose langage that supporting instructions only with a ";" (semicolon). |
How to install it
To install testa, it's really simple, you just have to run:
pip install tsta
# Then cd to the directory tha tcontain your testa.json file
# and run :
tsta
# That's all, a report will be generated
How to use it
In your code, make sure to enclose the instructions you want to test with the testa grammar, for example:
- In Python:
# For a Simple assertion:
# ::import_start::
# --- Your imports here, if your methods need them ---
# ::import_end::
# ::testa_start::
# ::case_start::
# >> testa.isEqual(2, 2)
# << true
# ::case_end::
# ::testa_end::
#
# ::doc_start::
# .
# Here a small description of the function that will be generate on the documentation
# .
# ::doc_end::
#
# With methods :
# ::testa_start::
# ::case_start::
# >> addition(2, 2)
# << 4
# ::case_end::
# ::code_start::
def addition(a, b):
return a+b
# ::code_end::
# ::testa_end::
- In Javascript:
// ::import_start::
// --- Your imports here ---
// ::import_end::
// For a Simple assertion:
// ::testa_start::
// ::case_start::
// >> testa.isEqual(2, 2)
// << true
// ::case_end::
// ::testa_end::
// For more instructions:
// ::testa_start::
// ::case_start::
// >> addition(2, 2)
// << 4
// ::case_end::
//
// ::doc_start::
// .
// Here a small description of the function that will be generate on the documentation
// .
// ::doc_end::
//
// ::code_start::
// --- Your specific list of instruction / functions source code here!
function addition(a, b){
return a+b
}
// ::code_end::
// ::testa_end::
- In php :
// ::testa_start::
// ::case_start::
// >> square(9)
// << 3
// ::case_end::
// ::code_start::
function square($a){
return sqrt($a);
}
// ::code_end::
// ::testa_end::
- In Ruby :
# ::testa_start::
# ::case_start::
# >> square(9)
# << 3.0
# ::case_end::
# ::code_start::
def square(a)
return a/2
# ::code_end::
# ::testa_end::
And that's where the magic of Testa is, for any language, you have only to write a simple JSON file and specify paths where you will do tests.
Author
- Sanix darker
Metadata
Release files for tsta 0.0.1.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| tsta-0.0.1.6.tar.gz | 25.3 kB | Without provenance | Details for tsta-0.0.1.6.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| tsta-0.0.1.6-py3-none-any.whl | Python 3 | none | any | Details for tsta-0.0.1.6-py3-none-any.whl |
Total release size: 49.6 kB
Release files / tsta-0.0.1.6.tar.gz
| Download URL | tsta-0.0.1.6.tar.gz |
|---|---|
| Size | 25.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cbb7e0fbafbca61fd41e92e7e6d2401f6bfb827093c019a8ec4d928b0845fa68
|
|
BLAKE2b-256 checksum How to use checksums |
2cf3498d479ca679d5ab2193bf35bcb3c0f40501ce80c0df3c8a7b2c7e49c2be
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10
|
Release files / tsta-0.0.1.6-py3-none-any.whl
| Download URL | tsta-0.0.1.6-py3-none-any.whl |
|---|---|
| Size | 24.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
85054c8cff82f4954c6af966189f781db682dec130b4e522e68c9e4946c92733
|
|
BLAKE2b-256 checksum How to use checksums |
6253a3965930c193b76f1f6084bae8684a22c049cff3bcbb3b6e0bd08ffd47e0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10
|
Security for tsta 0.0.1.6
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.