Add assert_startswith/endswith helper functions

This commit is contained in:
Hugo 2018-04-16 18:31:33 +03:00
parent fa601b8111
commit 60dea38d10
6 changed files with 23 additions and 17 deletions

View file

@ -52,6 +52,12 @@ class PyLastTestCase(unittest.TestCase):
api_key=API_KEY, api_secret=API_SECRET,
username=self.username, password_hash=password_hash)
def assert_startswith(self, str, prefix, start=None, end=None):
self.assertTrue(str.startswith(prefix, start, end))
def assert_endswith(self, str, suffix, start=None, end=None):
self.assertTrue(str.endswith(suffix, start, end))
def helper_is_thing_hashable(self, thing):
# Arrange
things = set()