Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from string_equivilence import eq
- import pytest
- @pytest.mark.parametrize("string1, string2", [
- ("String1", "string1"),
- ("string 1", "string1"),
- ("hello_world", "hello world"),
- ("HelloWorld", "hello world"),
- ("Hello world!", "hello world?"),
- ("!!!helloWorld!!!", "helloworld"),
- ("Yes!", "yes"),
- ("CASE", "case"),
- ("issymbol", "Is symbol"),
- ])
- def test_positive_eq(string1, string2):
- assert eq(string1, string2)
- # make sure eq is commutative
- assert eq(string2, string1)
- @pytest.mark.parametrize("string1, string2", [
- ("string1", "string2"),
- ("string 1", "not string1"),
- ("cat", "dog"),
- ("yes", "no"),
- ("case a", "case b"),
- ("case1", "case2")
- ])
- def test_negative_eq(string1, string2):
- assert not eq(string1, string2)
- assert not eq(string2, string1)
Advertisement
Add Comment
Please, Sign In to add comment