gimp/libgimp/test/test_pattern.py
lloyd konneker d720375e97 2.99 libgimp: add GimpResource, GimpBrush, GimpPropWidgetBrush
So procedures can declare args and GimpProcedureDialog show chooser
widgets

Fix so is no error dialog on id_is_valid for resources

Palette.pdb changes and testing

Memory mgt changes

Gradient pdb

Font and Pattern tests

Test  brush, palette

Cleanup, remove generator

Rebase, edit docs, install test-dialog.py

Whitespace, and fix failed distcheck

Fix some clang-format, fix fail distcheck

Fix distcheck

Cleanup from review Jehan
2023-01-14 12:58:05 +00:00

42 lines
941 B
Python

"""
Python to test GimpPattern class of libgimp API.
See comments about usage and setup in test-resource-class.py
Paste into the Python Console and expect no exceptions.
Setup: "Pine" Pattern is selected.
Testing some class methods is in test_resource_class.py
Class has no setters.
Object is not editable.
Class has no is_editable() method.
"""
"""
Test a known, stock pattern "Pine"
!!! Test numeric literals must change if the pattern is changed.
"""
pattern_pine = Gimp.context_get_pattern()
assert pattern_pine.get_id() == "Pine"
"""
Test getters
"""
success, width, height, bpp = pattern_pine.get_info()
print( width, height, bpp)
assert success
assert width == 64
assert height == 56
assert bpp == 3
success, width, height, bpp, pixels = pattern_pine.get_pixels()
print( len(pixels) )
assert success
assert width == 64
assert height == 56
assert bpp == 3
assert len(pixels) == 10752
# Not testing the pixels content