Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_invalid_parameters(self):
assert mid(VALUE_ERROR, 2, 2) == VALUE_ERROR
assert mid('Romain', VALUE_ERROR, 2) == VALUE_ERROR
assert mid('Romain', 2, VALUE_ERROR) == VALUE_ERROR
assert mid(DIV0, 2, 2) == DIV0
assert mid('Romain', DIV0, 2) == DIV0
assert mid('Romain', 2, DIV0) == DIV0
assert mid('Romain', 'x', 2) == VALUE_ERROR
assert mid('Romain', 2, 'x') == VALUE_ERROR
def test_invalid_parameters(self):
assert mid(VALUE_ERROR, 2, 2) == VALUE_ERROR
assert mid('Romain', VALUE_ERROR, 2) == VALUE_ERROR
assert mid('Romain', 2, VALUE_ERROR) == VALUE_ERROR
assert mid(DIV0, 2, 2) == DIV0
assert mid('Romain', DIV0, 2) == DIV0
assert mid('Romain', 2, DIV0) == DIV0
assert mid('Romain', 'x', 2) == VALUE_ERROR
assert mid('Romain', 2, 'x') == VALUE_ERROR
def test_num_chars_must_be_integer(self):
assert 'Ro' == mid('Romain', 1, 2.1)
def test_invalid_parameters(self):
assert mid(VALUE_ERROR, 2, 2) == VALUE_ERROR
assert mid('Romain', VALUE_ERROR, 2) == VALUE_ERROR
assert mid('Romain', 2, VALUE_ERROR) == VALUE_ERROR
assert mid(DIV0, 2, 2) == DIV0
assert mid('Romain', DIV0, 2) == DIV0
assert mid('Romain', 2, DIV0) == DIV0
assert mid('Romain', 'x', 2) == VALUE_ERROR
assert mid('Romain', 2, 'x') == VALUE_ERROR
def test_from_not_str(self):
assert '23' == mid(1234, 2, 2)
def test_mid(self):
assert 'omain' == mid('Romain', 2, 9)
assert 'om' == mid('Romain', 2.1, 2)
assert 'om' == mid('Romain', 2, 2.1)
def test_mid(self):
assert 'omain' == mid('Romain', 2, 9)
assert 'om' == mid('Romain', 2.1, 2)
assert 'om' == mid('Romain', 2, 2.1)
def test_invalid_parameters(self):
assert mid(VALUE_ERROR, 2, 2) == VALUE_ERROR
assert mid('Romain', VALUE_ERROR, 2) == VALUE_ERROR
assert mid('Romain', 2, VALUE_ERROR) == VALUE_ERROR
assert mid(DIV0, 2, 2) == DIV0
assert mid('Romain', DIV0, 2) == DIV0
assert mid('Romain', 2, DIV0) == DIV0
assert mid('Romain', 'x', 2) == VALUE_ERROR
assert mid('Romain', 2, 'x') == VALUE_ERROR
def test_invalid_parameters(self):
assert mid(VALUE_ERROR, 2, 2) == VALUE_ERROR
assert mid('Romain', VALUE_ERROR, 2) == VALUE_ERROR
assert mid('Romain', 2, VALUE_ERROR) == VALUE_ERROR
assert mid(DIV0, 2, 2) == DIV0
assert mid('Romain', DIV0, 2) == DIV0
assert mid('Romain', 2, DIV0) == DIV0
assert mid('Romain', 'x', 2) == VALUE_ERROR
assert mid('Romain', 2, 'x') == VALUE_ERROR
def test_invalid_parameters(self):
assert mid(VALUE_ERROR, 2, 2) == VALUE_ERROR
assert mid('Romain', VALUE_ERROR, 2) == VALUE_ERROR
assert mid('Romain', 2, VALUE_ERROR) == VALUE_ERROR
assert mid(DIV0, 2, 2) == DIV0
assert mid('Romain', DIV0, 2) == DIV0
assert mid('Romain', 2, DIV0) == DIV0
assert mid('Romain', 'x', 2) == VALUE_ERROR
assert mid('Romain', 2, 'x') == VALUE_ERROR