chore: add documentation RI
Code functionality left unchanged, only added docs where missing close: N25B-298
This commit is contained in:
@@ -6,11 +6,21 @@ from robot_interface.utils.timeblock import TimeBlock
|
||||
|
||||
|
||||
class AnyFloat(object):
|
||||
"""
|
||||
A helper class used in tests to assert that a mock function was called
|
||||
with an argument that is specifically a float, regardless of its value.
|
||||
|
||||
It overrides the equality comparison (`__eq__`) to check only the type.
|
||||
"""
|
||||
def __eq__(self, other):
|
||||
return isinstance(other, float)
|
||||
|
||||
|
||||
def test_no_limit():
|
||||
"""
|
||||
Tests the scenario where the `TimeBlock` context manager is used without
|
||||
a time limit.
|
||||
"""
|
||||
callback = mock.Mock()
|
||||
|
||||
with TimeBlock(callback):
|
||||
@@ -20,6 +30,10 @@ def test_no_limit():
|
||||
|
||||
|
||||
def test_exceed_limit():
|
||||
"""
|
||||
Tests the scenario where the execution time within the `TimeBlock`
|
||||
exceeds the provided limit.
|
||||
"""
|
||||
callback = mock.Mock()
|
||||
|
||||
with TimeBlock(callback, 0):
|
||||
@@ -29,6 +43,10 @@ def test_exceed_limit():
|
||||
|
||||
|
||||
def test_within_limit():
|
||||
"""
|
||||
Tests the scenario where the execution time within the `TimeBlock`
|
||||
stays within the provided limit.
|
||||
"""
|
||||
callback = mock.Mock()
|
||||
|
||||
with TimeBlock(callback, 5):
|
||||
|
||||
Reference in New Issue
Block a user