diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:35:29 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:35:29 +0000 |
commit | 59203c63bb777a3bacec32fb8830fba33540e809 (patch) | |
tree | 58298e711c0ff0575818c30485b44a2f21bf28a0 /toolkit/components/uniffi-fixtures/todolist/tests/bindings/test_todolist.py | |
parent | Adding upstream version 126.0.1. (diff) | |
download | firefox-59203c63bb777a3bacec32fb8830fba33540e809.tar.xz firefox-59203c63bb777a3bacec32fb8830fba33540e809.zip |
Adding upstream version 127.0.upstream/127.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'toolkit/components/uniffi-fixtures/todolist/tests/bindings/test_todolist.py')
-rw-r--r-- | toolkit/components/uniffi-fixtures/todolist/tests/bindings/test_todolist.py | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/toolkit/components/uniffi-fixtures/todolist/tests/bindings/test_todolist.py b/toolkit/components/uniffi-fixtures/todolist/tests/bindings/test_todolist.py new file mode 100644 index 0000000000..e4e2cda6d6 --- /dev/null +++ b/toolkit/components/uniffi-fixtures/todolist/tests/bindings/test_todolist.py @@ -0,0 +1,56 @@ +from todolist import TodoEntry, TodoList, get_default_list, set_default_list + +todo = TodoList() + +entry = TodoEntry(text="Write bindings for strings in records") + +todo.add_item("Write python bindings") + +assert todo.get_last() == "Write python bindings" + +todo.add_item("Write tests for bindings") + +assert todo.get_last() == "Write tests for bindings" + +todo.add_entry(entry) + +assert todo.get_last() == "Write bindings for strings in records" +assert todo.get_last_entry().text == "Write bindings for strings in records" + +todo.add_item( + "Test Ünicode hàndling without an entry can't believe I didn't test this at first 🤣" +) +assert ( + todo.get_last() + == "Test Ünicode hàndling without an entry can't believe I didn't test this at first 🤣" +) + +entry2 = TodoEntry( + text="Test Ünicode hàndling in an entry can't believe I didn't test this at first 🤣" +) +todo.add_entry(entry2) +assert ( + todo.get_last_entry().text + == "Test Ünicode hàndling in an entry can't believe I didn't test this at first 🤣" +) + +todo2 = TodoList() +assert todo != todo2 +assert todo is not todo2 + +assert get_default_list() is None + +set_default_list(todo) +assert todo.get_items() == get_default_list().get_items() + +todo2.make_default() +assert todo2.get_items() == get_default_list().get_items() + +todo.add_item("Test liveness after being demoted from default") +assert todo.get_last() == "Test liveness after being demoted from default" + +todo2.add_item("Test shared state through local vs default reference") +assert ( + get_default_list().get_last() + == "Test shared state through local vs default reference" +) |