def test_filename_from_title(self): self.assertEqual(make_filename_from_title(), _("No Title")) self.assertEqual(make_filename_from_title(""), _("No Title")) self.assertEqual(make_filename_from_title(" "), _("No Title")) self.assertEqual(make_filename_from_title(default="New Default"), "New Default") self.assertEqual(make_filename_from_title("", "New Default"), "New Default") self.assertEqual(make_filename_from_title("/"), "_")
def test_filename_from_title_win32(self): self.assertEqual(make_filename_from_title("\\"), "_") self.assertEqual(make_filename_from_title(":"), "_")
def filename(self): return make_filename_from_title(self.title, _("Unnamed Script"))