def test_access(self, root): layout = Plasma() layout.root = root layout.add('a') now = datetime.now() assert layout.root.find_payload('a').last_accessed < now layout.focus('a') assert layout.root.find_payload('a').last_accessed > now
def test_focus(self, root): layout = Plasma() layout.root = root a, b, c, d = 'abcd' layout.add(a) layout.add(b) layout.add(c) layout.add(d) assert layout.focus_first() == 'a' assert layout.focus_last() == 'd' assert layout.focus_next('b') == 'c' assert layout.focus_previous('c') == 'b' layout.focus('c') assert layout.focused is c