Skip to content

Commit

Permalink
Internal alias property details should not be assumed and tested.
Browse files Browse the repository at this point in the history
  • Loading branch information
matham committed May 26, 2016
1 parent 1133a1a commit 208c5eb
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions kivy/tests/test_properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,28 +310,20 @@ def _set_prop(self, value):
self.assertEqual(wid.basevalue, 1)
self.assertEqual(observe_called, 0)

# first call, goes in cache
self.assertEqual(wid.prop, 2)
self.assertEqual(observe_called, 1)

# second call, cache used
self.assertEqual(wid.prop, 2)
self.assertEqual(observe_called, 1)

# change the base value, should trigger an update for the cache
wid.basevalue = 4
self.assertEqual(observe_called, 2)
self.assertEqual(observe_called, 1)

# now read the value again, should use the cache too
# now read the value again, should use the cache
self.assertEqual(wid.prop, 8)
self.assertEqual(observe_called, 2)
self.assertEqual(observe_called, 1)

# change the prop itself, should trigger an update for the cache
wid.prop = 4
self.assertEqual(observe_called, 3)
self.assertEqual(observe_called, 2)
self.assertEqual(wid.basevalue, 2)
self.assertEqual(wid.prop, 4)
self.assertEqual(observe_called, 3)
self.assertEqual(observe_called, 2)

def test_bounded_numeric_property(self):
from kivy.properties import BoundedNumericProperty
Expand Down

0 comments on commit 208c5eb

Please sign in to comment.