jhylands

test_string_equivilence.py

Feb 7th, 2021
571
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.78 KB | None | 0 0
  1. from string_equivilence import eq
  2. import pytest
  3.  
  4.  
  5. @pytest.mark.parametrize("string1, string2", [
  6. ("String1", "string1"),
  7. ("string 1", "string1"),
  8. ("hello_world", "hello world"),
  9. ("HelloWorld", "hello world"),
  10. ("Hello world!", "hello world?"),
  11. ("!!!helloWorld!!!", "helloworld"),
  12. ("Yes!", "yes"),
  13. ("CASE", "case"),
  14. ("issymbol", "Is symbol"),
  15. ])
  16. def test_positive_eq(string1, string2):
  17.     assert eq(string1, string2)
  18.     # make sure eq is commutative
  19.     assert eq(string2, string1)
  20.  
  21.  
  22. @pytest.mark.parametrize("string1, string2", [
  23. ("string1", "string2"),
  24. ("string 1", "not string1"),
  25. ("cat", "dog"),
  26. ("yes", "no"),
  27. ("case a", "case b"),
  28. ("case1", "case2")
  29. ])
  30. def test_negative_eq(string1, string2):
  31.     assert not eq(string1, string2)
  32.     assert not eq(string2, string1)
  33.  
Advertisement
Add Comment
Please, Sign In to add comment