Add backdrop api and test
This commit is contained in:
@@ -2488,5 +2488,44 @@ class TestApi:
|
||||
self.leave(p)
|
||||
|
||||
|
||||
# 27 backdrop
|
||||
|
||||
|
||||
def test_backdrop(self):
|
||||
p = 'test_backdrop'
|
||||
self.enter(p)
|
||||
|
||||
assert get_backdrop(p)['content'] == ''
|
||||
|
||||
set_backdrop(p, ChangeSet({'content': 'x'}))
|
||||
assert get_backdrop(p)['content'] == 'x'
|
||||
|
||||
self.leave(p)
|
||||
|
||||
|
||||
def test_backdrop_op(self):
|
||||
p = 'test_backdrop_op'
|
||||
self.enter(p)
|
||||
|
||||
cs = set_backdrop(p, ChangeSet({'content': 'x'})).operations[0]
|
||||
assert cs['operation'] == API_UPDATE
|
||||
assert cs['type'] == 'backdrop'
|
||||
assert cs['content'] == 'x'
|
||||
|
||||
cs = execute_undo(p).operations[0]
|
||||
assert cs['operation'] == API_UPDATE
|
||||
assert cs['type'] == 'backdrop'
|
||||
assert cs['content'] == ''
|
||||
|
||||
cs = execute_redo(p).operations[0]
|
||||
assert cs['operation'] == API_UPDATE
|
||||
assert cs['type'] == 'backdrop'
|
||||
assert cs['content'] == 'x'
|
||||
|
||||
self.leave(p)
|
||||
|
||||
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
pytest.main()
|
||||
|
||||
Reference in New Issue
Block a user