Commit 5f0235ce authored by Mathieu Giraud's avatar Mathieu Giraud

src/should.py: actual test of TestLine.expected_count

parent cfc2e061
Pipeline #737 failed with stages
in 0 seconds
......@@ -23,9 +23,9 @@ class ShouldException(BaseException):
class TestLine():
'''
>>> test = TestLine('3', 'hello')
>>> test = TestLine('', 'hello')
>>> print(test)
3:hello
:hello
>>> test.test(['world'])
>>> test.status
......@@ -35,6 +35,20 @@ class TestLine():
>>> test.status
True
>>> test = TestLine('3', 'hello')
>>> print(test)
3:hello
>>> test.test(['hello'])
>>> test.status
False
>>> test.test(['hello'] * 3)
>>> test.status
True
>>> print(TestLine('x3y', 'hello'))
xy3:hello
......@@ -65,7 +79,7 @@ class TestLine():
if self.expression in l:
count += 1
self.status = (count > 0)
self.status = (count > 0) if self.expected_count is None else (count == self.expected_count)
def __str__(self):
s = ''
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment