def test_tld_migration_needed(self): """ Test the tld migration of Transifex, when needed. """ hostnames = [ 'http://transifex.net', 'http://www.transifex.net', 'https://fedora.transifex.net', ] for h in hostnames: hostname = hostname_tld_migration(h) self.assertTrue(hostname.endswith('com')) orig_hostname = 'http://www.transifex.net/path/' hostname = hostname_tld_migration(orig_hostname) self.assertEqual(hostname, orig_hostname.replace('net', 'com', 1))
def test_tld_migration_needed(self): """ Test that unneeded tld migrations are detected correctly. """ hostnames = [ 'https://www.transifex.com', 'http://fedora.transifex.com', 'http://www.example.net/path/' ] for h in hostnames: hostname = hostname_tld_migration(h) self.assertEqual(hostname, h)