def test_parse_externals_swapped(self): self.assertEqual( {'third-party/sounds': (None, "http://sounds.red-bean.com/repos")}, properties.parse_externals_description( "http://example.com", """\ http://sounds.red-bean.com/repos third-party/sounds """))
def test_parse_externals(self): self.assertEqual({ 'third-party/sounds': (None, "http://sounds.red-bean.com/repos"), 'third-party/skins': (None, "http://skins.red-bean.com/repositories/skinproj"), 'third-party/skins/toolkit': (21, "http://svn.red-bean.com/repos/skin-maker")}, properties.parse_externals_description("http://example.com", """third-party/sounds http://sounds.red-bean.com/repos third-party/skins http://skins.red-bean.com/repositories/skinproj third-party/skins/toolkit -r21 http://svn.red-bean.com/repos/skin-maker"""))
def test_parse_externals_space_revno(self): self.assertEqual( { 'third-party/skins/toolkit': (21, "http://svn.red-bean.com/repos/skin-maker") }, properties.parse_externals_description( "http://example.com", """\ third-party/skins/toolkit -r 21 http://svn.red-bean.com/repos/skin-maker"""))
def test_parse_repos_root_relative(self): self.assertEqual( { 'third-party/sounds': (None, "http://example.com/bar/bla/branches/other"), }, properties.parse_externals_description( "http://example.com/trunk", "third-party/sounds /bar/bla/branches/other"))
def test_parse_comment(self): self.assertEqual( {'third-party/sounds': (None, "http://sounds.red-bean.com/repos")}, properties.parse_externals_description( "http://example.com/", """\ third-party/sounds http://sounds.red-bean.com/repos #third-party/skins http://skins.red-bean.com/repositories/skinproj #third-party/skins/toolkit -r21 http://svn.red-bean.com/repos/skin-maker"""))
def test_parse_relative(self): self.assertEqual({ 'third-party/sounds': (None, "http://example.com/branches/other"), }, properties.parse_externals_description("http://example.com/trunk", "third-party/sounds ../branches/other"))
def test_parse_externals_swapped(self): self.assertEqual({'third-party/sounds': (None, "http://sounds.red-bean.com/repos")}, properties.parse_externals_description("http://example.com", """http://sounds.red-bean.com/repos third-party/sounds """))
def test_parse_externals_space_revno(self): self.assertEqual({ 'third-party/skins/toolkit': (21, "http://svn.red-bean.com/repos/skin-maker")}, properties.parse_externals_description("http://example.com", """third-party/skins/toolkit -r 21 http://svn.red-bean.com/repos/skin-maker"""))
def test_parse_invalid_too_much_data(self): """No URL specified.""" self.assertRaises(properties.InvalidExternalsDescription, lambda: properties.parse_externals_description(None, "bla -R40 http://bla/"))
def test_parse_invalid_missing_url(self): """No URL specified.""" self.assertRaises(properties.InvalidExternalsDescription, lambda: properties.parse_externals_description("http://example.com/", "bla"))
def test_parse_invalid_too_much_data(self): """No URL specified.""" self.assertRaises( properties.InvalidExternalsDescription, lambda: properties.parse_externals_description( None, "bla -R40 http://bla/"))
def test_parse_invalid_missing_url(self): """No URL specified.""" self.assertRaises( properties.InvalidExternalsDescription, lambda: properties.parse_externals_description( "http://example.com/", "bla"))