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

@ -19,7 +19,7 @@ class TestPyLastLibrary(PyLastTestCase):
representation = repr(library)
# Assert
self.assertTrue(representation.startswith("pylast.Library("))
self.assert_startswith(representation, "pylast.Library(")
def test_str(self):
# Arrange
@ -29,7 +29,7 @@ class TestPyLastLibrary(PyLastTestCase):
string = str(library)
# Assert
self.assertTrue(string.endswith("'s Library"))
self.assert_endswith(string, "'s Library")
def test_library_is_hashable(self):
# Arrange