A Sentence decorator for dynamic log messages.
Project description
dialoget - python library
python.dialoget.com is a test framework for multilanguage source code, based on decorators
The test directory structure for Python and Java projects will often follow conventions that are supported by popular testing frameworks and project management tools. Below, are typical structures for both languages, which help in organizing tests based on their type (e.g., unit tests, functional tests, integration tests).
dialoget/
│
├── src/
│ └── dialoget.py # Python file with code for the package
│
├── tests/ # Unit tests for the package
│ ├── dialoget.py
│ └── test_module2.py
│
├── docs/ # Documentation for the package
│ ├── conf.py
│ ├── index.rst
│ └── ...
│
├── README.md # README file with a description of the package, installation instructions, etc.
├── LICENSE # License file specifying how the package can be used and shared
├── setup.py # Setuptools script for installation and distribution of the package
├── setup.cfg # Configuration settings for setuptools
├── requirements.txt # File listing all dependencies for the package
└── .gitignore # Specifies intentionally untracked files to ignore for git
build
build your package, first ensure you have the latest versions of build and wheel installed:
pip install --upgrade build wheel
install
Run the build module from the root of the project where the pyproject.toml file is located:
python -m build
This command will generate distribution files in the newly created dist/ directory within your project. You will find both a source archive (.tar.gz) and a wheel file (.whl).
After the build completes successfully, you can upload your package to PyPI using twine:
pip install --upgrade twine
twine upload dist/*
init
pip install --upgrade pip
pip install requests
pip install setuptools
Test
pytest
#python3 setup.py sdist bdist_wheel
Build
python -m build
#python3 setup.py sdist bdist_wheel
Publish
``bash twine upload dist/*
### Python
In Python projects, tests are often placed in a separate directory, commonly named `tests`. Each category of test may be placed in its own subdirectory. Here is an example structure that might be used in a Python project:
my_python_project/ │ ├── my_project/ │ ├── module1.py │ └── module2.py │ ├── tests/ │ ├── unit/ │ │ ├── test_module1.py │ │ └── test_module2.py │ │ │ ├── functional/ │ │ └── test_something_functional.py │ │ │ └── integration/ │ └── test_integration.py │ └── setup.py (or pyproject.toml, or requirements.txt, depending on the project)
This structure separates the test types into different subdirectories, making it easier to manage them and execute them separately. Note that each test directory typically contains an `__init__.py` file, which is necessary for the Python test discovery mechanisms in most testing frameworks, such as `unittest` or `pytest`.
### Java
Java projects often use Maven or Gradle as build tools, and the default conventions for these tools define specific directories for different types of tests. Here's how a Maven project might structure its tests:
my_java_project/ │ ├── src/ │ ├── main/ │ │ └── java/ │ │ └── com/ │ │ └── mycompany/ │ │ └── myproject/ │ │ ├── Module1.java │ │ └── Module2.java │ │ │ └── test/ │ ├── java/ │ │ └── com/ │ │ └── mycompany/ │ │ └── myproject/ │ │ ├── unit/ │ │ │ ├── Module1Test.java │ │ │ └── Module2Test.java │ │ │ │ │ ├── functional/ │ │ │ └── SomethingFunctionalTest.java │ │ │ │ │ └── integration/ │ │ └── IntegrationTest.java │ │ │ └── resources/ │ └── pom.xml
In this structure, all Java source files are located in `src/main/java`, and test files are located in `src/test/java`. Tests are further organized into subdirectories (unit, functional, and integration), corresponding to each type of test within the `test` directory.
It's important to note that while you can organize the tests into subdirectories in Java, the use of package naming conventions is more common. Test frameworks like JUnit do not enforce a particular directory structure, but they do differentiate tests based on annotations or naming conventions within the code.
The Maven directory structure (`src/main/java` for source code and `src/test/java` for test code) is a convention that tools recognize, and they are configured to compile and execute tests based on this layout.
As best practice, both Python and Java projects should have good separation of test types. This makes it clear what each test is designed to achieve and allows for the selective execution of test suites based on the scope of changes or the stage of the development pipeline.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dialoget-0.0.1.tar.gz.
File metadata
- Download URL: dialoget-0.0.1.tar.gz
- Upload date:
- Size: 7.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.12.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
675b25513d6a34f85f7c179ef7c57730a9e295e56a28fb0bfb85e78b0752e432
|
|
| MD5 |
89965122c29e18f058d70ee7881802e3
|
|
| BLAKE2b-256 |
35c5ad4c4b9e38eb4a7397c160c5e314d3ad5033261e0a763fe0fe6ce02babf6
|
File details
Details for the file dialoget-0.0.1-py3-none-any.whl.
File metadata
- Download URL: dialoget-0.0.1-py3-none-any.whl
- Upload date:
- Size: 7.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.12.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bc8292af61a2c83c5e83f07d0bdffbbd7ae996a738fa4265e67b216dc8281a8e
|
|
| MD5 |
4b124c5d1d100e6479be9884b97649bb
|
|
| BLAKE2b-256 |
b6f081c188505ef7cf37495c3cdd5aca21dc8dd418409b5345b2a2094622540c
|