def test_real_world(self) -> None: service = format_service_name("wnas", "serverway:/var/backups/mysql", "/data/backup/host/serverway/mysql") self.assertEqual( service, "rsync_wnas_serverway-var-backups-mysql_" "data-backup-host-serverway-mysql", )
def test_multiple_dashs_underscore(self) -> None: self.assertEqual(format_service_name("---_---", "", ""), "rsync_")
def test_dash_underscore(self) -> None: self.assertEqual(format_service_name("-_-", "", ""), "rsync_")
def test_tilde(self) -> None: self.assertEqual(format_service_name("l~o~l", "tmp1", "tmp2"), "rsync_l-o-l_tmp1_tmp2")
def test_special_characters(self) -> None: self.assertEqual(format_service_name("/@:.", "", ""), "rsync_")