11 lines
388 B
Python
11 lines
388 B
Python
def assertPreWith(string: str, sub: str):
|
|
if not string.startswith(sub):
|
|
raise AssertionError('%s does not starts with %s' % (string, sub))
|
|
|
|
|
|
def assertSufWith(string: str, sub: str):
|
|
if not string.endswith(sub):
|
|
raise AssertionError('%s does not ends with %s' % (string, sub))
|
|
|
|
assertSufWith('admin 123456 ...', '...')
|
|
assertPreWith('admin 123456 ...', 'admin 1') |