aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_strings.py')
-rw-r--r--tests/test_strings.py34
1 files changed, 16 insertions, 18 deletions
diff --git a/tests/test_strings.py b/tests/test_strings.py
index b55c230..1930570 100644
--- a/tests/test_strings.py
+++ b/tests/test_strings.py
@@ -3,38 +3,36 @@ from snakeoil.strings import doc_dedent, pluralism
class TestPluralism:
-
def test_none(self):
# default
- assert pluralism([]) == 's'
+ assert pluralism([]) == "s"
# different suffix for nonexistence
- assert pluralism([], none='') == ''
+ assert pluralism([], none="") == ""
def test_singular(self):
# default
- assert pluralism([1]) == ''
+ assert pluralism([1]) == ""
# different suffix for singular existence
- assert pluralism([1], singular='o') == 'o'
+ assert pluralism([1], singular="o") == "o"
def test_plural(self):
# default
- assert pluralism([1, 2]) == 's'
+ assert pluralism([1, 2]) == "s"
# different suffix for plural existence
- assert pluralism([1, 2], plural='ies') == 'ies'
+ assert pluralism([1, 2], plural="ies") == "ies"
def test_int(self):
- assert pluralism(0) == 's'
- assert pluralism(1) == ''
- assert pluralism(2) == 's'
+ assert pluralism(0) == "s"
+ assert pluralism(1) == ""
+ assert pluralism(2) == "s"
class TestDocDedent:
-
def test_empty(self):
- s = ''
+ s = ""
assert s == doc_dedent(s)
def test_non_string(self):
@@ -42,20 +40,20 @@ class TestDocDedent:
doc_dedent(None)
def test_line(self):
- s = 'line'
+ s = "line"
assert s == doc_dedent(s)
def test_indented_line(self):
- for indent in ('\t', ' '):
- s = f'{indent}line'
- assert 'line' == doc_dedent(s)
+ for indent in ("\t", " "):
+ s = f"{indent}line"
+ assert "line" == doc_dedent(s)
def test_docstring(self):
s = """Docstring to test.
foo bar
"""
- assert 'Docstring to test.\n\nfoo bar\n' == doc_dedent(s)
+ assert "Docstring to test.\n\nfoo bar\n" == doc_dedent(s)
def test_all_indented(self):
s = """\
@@ -63,4 +61,4 @@ class TestDocDedent:
foo bar
"""
- assert 'Docstring to test.\n\nfoo bar\n' == doc_dedent(s)
+ assert "Docstring to test.\n\nfoo bar\n" == doc_dedent(s)