Refuse any url with a scheme or path

This commit is contained in:
Eshan Singh
2018-01-05 10:46:36 +00:00
parent 04c25ca644
commit 7d154a3cfe
3 changed files with 18 additions and 7 deletions

View File

@@ -84,8 +84,11 @@ class ConfigTestCase(tcommon.TestCase):
self._config._parser.set('musicbrainz', 'server',
'192.168.2.141:5000/hello/world')
self._config.write()
self.assertEquals(self._config.get_musicbrainz_server(),
'192.168.2.141:5000',
msg='Correctly strips out path after port number')
self.assertRaises(KeyError, self._config.get_musicbrainz_server)
self._config._parser.set('musicbrainz', 'server',
'http://192.168.2.141:5000')
self._config.write()
self.assertRaises(KeyError, self._config.get_musicbrainz_server)
self._config._parser.remove_section('musicbrainz')