From 0beceefd0cb725a06de178407fdd5da497cdf462 Mon Sep 17 00:00:00 2001 From: Matthew Constable Date: Sun, 3 Feb 2019 17:51:06 +0000 Subject: [PATCH] Add a few tests for sets which reflect new changes. --- tests/snippets/test_sets.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 tests/snippets/test_sets.py diff --git a/tests/snippets/test_sets.py b/tests/snippets/test_sets.py new file mode 100644 index 000000000..8a06ee364 --- /dev/null +++ b/tests/snippets/test_sets.py @@ -0,0 +1,16 @@ + +empty_set = set() +non_empty_set = set([1,2,3]) + +assert 1 in non_empty_set +assert 4 not in non_empty_set + +# TODO: Assert that empty aruguments raises exception. +non_empty_set.add('a') +assert 'a' in non_empty_set + +# TODO: Assert that empty arguments, or item not in set raises exception. +non_empty_set.remove(1) +assert 1 not in non_empty_set + +# TODO: Assert that adding the same thing to a set once it's already there doesn't do anything.