Example #1
0
 def test_remove_last_n_chars_non_int(self):
     string = "12345"
     should_be = "12345"
     result = Misc.remove_last_n_char(string=string, char_num="a")
     self.assertEqual(result, should_be)
Example #2
0
 def test_remove_last_n_chars_more_chars(self):
     string = "12345"
     should_be = "123"
     result = Misc.remove_last_n_char(string=string, char_num=2)
     self.assertEqual(result, should_be)
Example #3
0
 def test_remove_last_n_chars_default(self):
     string = "12345"
     should_be = "1234"
     result = Misc.remove_last_n_char(string=string)
     self.assertEqual(result, should_be)
Example #4
0
 def test_remove_last_n_chars_non_int(self):
     string = "12345"
     should_be = "12345"
     result = Misc.remove_last_n_char(string=string, char_num="a")
     self.assertEqual(result, should_be)
Example #5
0
 def test_remove_last_n_chars_more_chars(self):
     string = "12345"
     should_be = "123"
     result = Misc.remove_last_n_char(string=string, char_num=2)
     self.assertEqual(result, should_be)
Example #6
0
 def test_remove_last_n_chars_default(self):
     string = "12345"
     should_be = "1234"
     result = Misc.remove_last_n_char(string=string)
     self.assertEqual(result, should_be)