AutoFramework/main5.py

11 lines
388 B
Python
Raw Normal View History

2022-08-12 11:21:21 +08:00
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')