Skip to content

Conversation

@vyagh
Copy link

@vyagh vyagh commented Jan 21, 2026

Fixes #7

Summary

Tests were accessing private attributes directly. This PR adds public accessor methods so tests use proper public API.

Progress

  • test_toolcombobox.py — 7 usages fixed
  • test_combobox.py — 34 usages fixed
  • More files to follow...

Testing

All existing tests pass. No regressions.

# Method might not exist in simplified version
pass

def test_do_set_property_invalid(self):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any particular reason for deleting this test?

tool_combo.set_label_text("Test Property")
self.assertEqual(tool_combo.get_label_text(), "Test Property")

def test_do_set_property_method(self):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason for deleting this?

Part of sugarlabs#7

- Add get_item_count() to ComboBox for test access
- Update test assertions to use existing public methods
@vyagh vyagh force-pushed the fix/tests-public-properties branch from 2e0a4eb to e3e3d8a Compare January 22, 2026 04:49
@vyagh
Copy link
Author

vyagh commented Jan 22, 2026

my bad, I overcomplicated it. Fixed it

@chimosky
Copy link
Member

Looks good so far, see making commits for future reference re commit messages.

- Add get_model(), get_item_at(), has_text_renderer(),
  has_icon_renderer(), is_separator_at() to ComboBox
- Update test assertions to use public API
@vyagh vyagh changed the title fix: replace private attribute access with GObject.Properties fix: use public methods instead of private attributes in tests Jan 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tests use private attributes.

2 participants