def test_split_empty_symbol(self): """ Case: split by empty symbol separator. Expected: ValueError raise. """ string_to_split, symbol_by_split = 'GameofThrones', '' expected_error = ValueError with self.assertRaises(expected_error): split(string_to_split, symbol_by_split)
def test_split(self, string_to_split, symbol_by_split): """ Test overall split cases. """ expected = ['Game', 'of', 'Thrones'] response = split(string_to_split, symbol_by_split) self.assertEqual(expected, response)
def test_split_none(self): """ Case: split by None separator. Expected: split works with None separator as like space symbol. """ string_to_split, symbol_by_split = 'GameofThrones', None expected = ['GameofThrones'] response = split(string_to_split, symbol_by_split) self.assertEqual(expected, response)
def make_suitable_url_parameters(url_parameter): """ Return a lowercase string with hyphen. """ return join(split(url_parameter, ' '), '-').lower()