Mock widgets for tkinter/ttk testing (Latin: Display Imitation)
Project description
Imitatio Ostendendi
Latin for "Display Imitation" - A comprehensive mocking library for tkinter/ttk testing
Features
- Mock implementations of common tkinter/ttk widgets
- Support for basic widget operations (insert, delete, configure)
- Event simulation capabilities
- Logging for better test debugging
- Easy integration with unittest.mock
Installation
pip install imitatio-ostendendi
Usage
from imitatio_ostendendi.widgets import Text, Entry, Button
from imitatio_ostendendi.constants import END, NORMAL, DISABLED
class TestMyGUIApp(TestCase):
def setUp(self):
# Create mock widgets
self.text = Text()
self.entry = Entry()
self.button = Button()
def test_text_operations(self):
# Insert text
self.text.insert("1.0", "Hello World")
self.assertEqual(self.text._text, "Hello World")
# Delete text
self.text.delete("1.0", END)
self.assertEqual(self.text._text, "")
def test_entry_state(self):
# Test state changes
self.entry.configure(state=DISABLED)
self.assertEqual(self.entry._state, DISABLED)
Widget Support
Currently supported widgets:
- Text
- Entry
- Button
- Frame
- LabelFrame
- Label
- Scrollbar
- Notebook
- StringVar
- IntVar
- BooleanVar
Why "Imitatio Ostendendi"?
The name comes from Latin:
- "Imitatio" meaning "imitation" or "mock"
- "Ostendendi" meaning "to display" or "to show"
Together, they form "Display Imitation" - a fitting name for a library that provides mock implementations of display widgets.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This project is licensed under the MIT License - see the LICENSE file for details.
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
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 imitatio_ostendendi-0.2.0.tar.gz.
File metadata
- Download URL: imitatio_ostendendi-0.2.0.tar.gz
- Upload date:
- Size: 11.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
98037702d6560eb0677c3c1986d220f1aa4ffcbf7f892cca4075d7212564f28b
|
|
| MD5 |
f0e4135a0f052646262a2da237bad28e
|
|
| BLAKE2b-256 |
025aae390b3b3c3bfeb909bf03feadde9d9d02e26d5e6ba781e1a274f73bd391
|
File details
Details for the file imitatio_ostendendi-0.2.0-py3-none-any.whl.
File metadata
- Download URL: imitatio_ostendendi-0.2.0-py3-none-any.whl
- Upload date:
- Size: 18.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c802108efc633217c426e3775885ad4eac145e84adc6b8fc537fa6f32e1b3215
|
|
| MD5 |
2577b732d02bce13a47f6d29d663cfc4
|
|
| BLAKE2b-256 |
fffb1b9c716758eb7d1304ae9950853caf9a24028b01c52f80046b0cd926d26a
|