예제 #1
0
 def test_getters_empty(self):
     data = {'vcs': 'svn',
             'vcs_uri': 'https://code.ros.org/svn/ros-pkg'}
     self.assertEqual('', locate.get_www(None, data, None))
     self.assertEqual('', locate.get_repo(None, data, None))
     self.assertEqual('https://code.ros.org/svn/ros-pkg', locate.get_vcs_uri_for_branch(data))
     self.assertEqual('https://code.ros.org/svn/ros-pkg', locate.get_vcs_uri_for_branch(data, 'release'))
     self.assertEqual('https://code.ros.org/svn/ros-pkg', locate.get_vcs_uri_for_branch(data, 'devel'))
     self.assertEqual('svn', locate.get_vcs(None, data, None))
     self.assertEqual('- svn:\n    local-name: myname\n    uri: https://code.ros.org/svn/ros-pkg\n',
                      locate.get_rosinstall('myname',
                                            data, 'mytype'))
     self.assertEqual('- svn:\n    local-name: myname\n    uri: https://code.ros.org/svn/ros-pkg\n',
                      locate.get_rosinstall('myname',
                                            data, 'mytype', 'devel'))
     self.assertEqual('- svn:\n    local-name: myname\n    uri: https://code.ros.org/svn/ros-pkg\n',
                      locate.get_rosinstall('myname',
                                            data, 'mytype', 'release'))
     self.assertEqual('- svn:\n    local-name: foo/myname\n    uri: https://code.ros.org/svn/ros-pkg\n',
                      locate.get_rosinstall('myname',
                                            data, 'mytype', None, 'foo'))
     self.assertEqual('https://code.ros.org/svn/ros-pkg',
                      locate.get_vcs_uri(data))
     self.assertEqual('', locate.get_vcs_version(data))
     self.assertEqual('package', locate.get_type(data))
예제 #2
0
 def test_getters_empty(self):
     data = {'vcs': 'svn',
             'vcs_uri': 'https://code.ros.org/svn/ros-pkg'}
     self.assertEqual('', locate.get_www(None, data, None))
     self.assertEqual('', locate.get_repo(None, data, None))
     self.assertEqual('https://code.ros.org/svn/ros-pkg', locate.get_vcs_uri_for_branch(data))
     self.assertEqual('https://code.ros.org/svn/ros-pkg', locate.get_vcs_uri_for_branch(data, 'release'))
     self.assertEqual('https://code.ros.org/svn/ros-pkg', locate.get_vcs_uri_for_branch(data, 'devel'))
     self.assertEqual('svn', locate.get_vcs(None, data, None))
     self.assertEqual('- svn:\n    local-name: myname\n    uri: https://code.ros.org/svn/ros-pkg\n',
                      locate.get_rosinstall('myname',
                                            data, 'mytype'))
     self.assertEqual('- svn:\n    local-name: myname\n    uri: https://code.ros.org/svn/ros-pkg\n',
                      locate.get_rosinstall('myname',
                                            data, 'mytype', 'devel'))
     self.assertEqual('- svn:\n    local-name: myname\n    uri: https://code.ros.org/svn/ros-pkg\n',
                      locate.get_rosinstall('myname',
                                            data, 'mytype', 'release'))
     self.assertEqual('- svn:\n    local-name: foo/myname\n    uri: https://code.ros.org/svn/ros-pkg\n',
                      locate.get_rosinstall('myname',
                                            data, 'mytype', None, 'foo'))
     self.assertEqual('https://code.ros.org/svn/ros-pkg',
                      locate.get_vcs_uri(data))
     self.assertEqual('', locate.get_vcs_version(data))
     self.assertEqual('package', locate.get_type(data))
예제 #3
0
 def test_get_with_branches(self):
     data = {
         'rosinstalls': {
             'devel': {
                 'hg': {
                     'local-name': 'navigation',
                     'uri': 'https://kforge.ros.org/test/devel',
                     'version': 'navigation-1.6'
                 }
             },
             'distro': {
                 'hg': {
                     'local-name': 'navigation',
                     'uri': 'https://kforge.ros.org/test/distro',
                     'version': 'electric'
                 }
             },
             'release': {
                 'hg': {
                     'local-name': 'navigation',
                     'uri': 'https://kforge.ros.org/test/rel',
                     'version': 'navigation-1.6.5'
                 }
             }
         },
         'vcs': 'svn',
         'vcs_uri': 'https://code.ros.org/svn/ros-pkg'
     }
     self.assertEqual('https://code.ros.org/svn/ros-pkg',
                      locate.get_vcs_uri_for_branch(data))
     self.assertEqual('https://kforge.ros.org/test/rel',
                      locate.get_vcs_uri_for_branch(data, 'release'))
     self.assertEqual('https://kforge.ros.org/test/devel',
                      locate.get_vcs_uri_for_branch(data, 'devel'))
     self.assertEqual('https://kforge.ros.org/test/distro',
                      locate.get_vcs_uri_for_branch(data, 'distro'))
     self.assertEqual('svn', locate.get_vcs(None, data, None))
     self.assertEqual('https://code.ros.org/svn/ros-pkg',
                      locate.get_vcs_uri(data))
     self.assertEqual('', locate.get_vcs_version(data))
     self.assertEqual('package', locate.get_type(data))
     self.assertEqual(
         '- svn:\n    local-name: myname\n    uri: https://code.ros.org/svn/ros-pkg\n',
         locate.get_rosinstall('myname', data, 'mytype'))
     self.assertEqual(
         '- hg:\n    local-name: navigation\n    uri: https://kforge.ros.org/test/devel\n    version: navigation-1.6\n',
         locate.get_rosinstall('myname', data, 'mytype', 'devel'))
     self.assertEqual(
         '- hg:\n    local-name: navigation\n    uri: https://kforge.ros.org/test/rel\n    version: navigation-1.6.5\n',
         locate.get_rosinstall('myname', data, 'mytype', 'release'))
     self.assertEqual(
         '- svn:\n    local-name: foo/myname\n    uri: https://code.ros.org/svn/ros-pkg\n',
         locate.get_rosinstall('myname', data, 'mytype', None, 'foo'))
예제 #4
0
 def test_get_with_branches(self):
     data = {
         'rosinstalls':
             {'devel':
                  {'hg':
                       {'local-name': 'navigation',
                        'uri': 'https://kforge.ros.org/test/devel',
                        'version': 'navigation-1.6'}},
              'distro':
                  {'hg':
                       {'local-name': 'navigation',
                        'uri': 'https://kforge.ros.org/test/distro',
                        'version': 'electric'}},
              'release':
                  {'hg':
                   {'local-name': 'navigation',
                    'uri': 'https://kforge.ros.org/test/rel',
                    'version': 'navigation-1.6.5'}}},
         'vcs': 'svn',
         'vcs_uri': 'https://code.ros.org/svn/ros-pkg'}
     self.assertEqual('https://code.ros.org/svn/ros-pkg',
                      locate.get_vcs_uri_for_branch(data))
     self.assertEqual('https://kforge.ros.org/test/rel',
                      locate.get_vcs_uri_for_branch(data, 'release'))
     self.assertEqual('https://kforge.ros.org/test/devel',
                      locate.get_vcs_uri_for_branch(data, 'devel'))
     self.assertEqual('https://kforge.ros.org/test/distro',
                      locate.get_vcs_uri_for_branch(data, 'distro'))
     self.assertEqual('svn', locate.get_vcs(None, data, None))
     self.assertEqual('https://code.ros.org/svn/ros-pkg', locate.get_vcs_uri(data))
     self.assertEqual('', locate.get_vcs_version(data))
     self.assertEqual('package', locate.get_type(data))
     self.assertEqual(
         '- svn:\n    local-name: myname\n    uri: https://code.ros.org/svn/ros-pkg\n',
         locate.get_rosinstall('myname',
                               data, 'mytype'))
     self.assertEqual(
         '- hg:\n    local-name: navigation\n    uri: https://kforge.ros.org/test/devel\n    version: navigation-1.6\n',
         locate.get_rosinstall('myname',
                               data, 'mytype', 'devel'))
     self.assertEqual(
         '- hg:\n    local-name: navigation\n    uri: https://kforge.ros.org/test/rel\n    version: navigation-1.6.5\n',
         locate.get_rosinstall('myname',
                               data, 'mytype', 'release'))
     self.assertEqual(
         '- svn:\n    local-name: foo/myname\n    uri: https://code.ros.org/svn/ros-pkg\n',
         locate.get_rosinstall('myname',
                               data, 'mytype', None, 'foo'))
예제 #5
0
 def test_getters(self):
     data = {'package_type': 'package',
             'repo_name': 'visualization',
             'repo_url': '',
             'srvs': [],
             'timestamp': 1362233859.0088351,
             'url': 'http://ros.org/wiki/rviz',
             'vcs': 'svn',
             'vcs_uri': 'https://code.ros.org/svn/ros-pkg',
             'vcs_version': '0.1',
             'repository': 'navigation'}
     self.assertEqual('http://ros.org/wiki/rviz', locate.get_www(None, data, None))
     self.assertEqual('navigation', locate.get_repo(None, data, None))
     self.assertEqual(
         '- svn:\n    local-name: foo/myname\n    uri: https://code.ros.org/svn/ros-pkg\n    version: \'0.1\'\n',
         locate.get_rosinstall('myname',
                               data, 'mytype', None, 'foo'))
     self.assertEqual('https://code.ros.org/svn/ros-pkg', locate.get_vcs_uri(data))
     self.assertEqual('0.1', locate.get_vcs_version(data))
     self.assertEqual('package', locate.get_type(data))
예제 #6
0
 def test_getters(self):
     data = {'package_type': 'package',
             'repo_name': 'visualization',
             'repo_url': '',
             'srvs': [],
             'timestamp': 1362233859.0088351,
             'url': 'http://ros.org/wiki/rviz',
             'vcs': 'svn',
             'vcs_uri': 'https://code.ros.org/svn/ros-pkg',
             'vcs_version': '0.1',
             'repository': 'navigation'}
     self.assertEqual('http://ros.org/wiki/rviz', locate.get_www(None, data, None))
     self.assertEqual('visualization', locate.get_repo(None, data, None))
     self.assertEqual(
         '- svn:\n    local-name: foo/myname\n    uri: https://code.ros.org/svn/ros-pkg\n    version: \'0.1\'\n',
         locate.get_rosinstall('myname',
                               data, 'mytype', None, 'foo'))
     self.assertEqual('https://code.ros.org/svn/ros-pkg', locate.get_vcs_uri(data))
     self.assertEqual('0.1', locate.get_vcs_version(data))
     self.assertEqual('package', locate.get_type(data))