コード例 #1
0
 def test__Manifest(self):
   from roslib.manifestlib import _Manifest
   m = _Manifest()
   # check defaults
   self.assertEquals('package', m._type)
   m = _Manifest('stack')
   self.assertEquals('stack', m._type)    
コード例 #2
0
ファイル: test_roslib_manifestlib.py プロジェクト: jonrf1/ros
 def test__Manifest(self):
     from roslib.manifestlib import _Manifest
     m = _Manifest()
     # check defaults
     self.assertEquals('package', m._type)
     m = _Manifest('stack')
     self.assertEquals('stack', m._type)
コード例 #3
0
ファイル: test_roslib_manifestlib.py プロジェクト: jonrf1/ros
 def test_Manifest_xml(self):
     from roslib.manifestlib import parse, _Manifest
     m = _Manifest()
     parse(m, EXAMPLE1)
     self._subtest_parse_example1(m)
     # verify roundtrip
     m2 = _Manifest()
     parse(m2, m.xml())
     self._subtest_parse_example1(m2)
コード例 #4
0
 def test_Manifest_xml(self):
   from roslib.manifestlib import parse, _Manifest
   m = _Manifest()
   parse(m, EXAMPLE1)
   self._subtest_parse_example1(m)
   # verify roundtrip
   m2 = _Manifest()
   parse(m2, m.xml())
   self._subtest_parse_example1(m2)
コード例 #5
0
    def test_parse_example1_file(self):
        from roslib.manifestlib import parse_file, _Manifest
        p = os.path.join(roslib.packages.get_pkg_dir('test_roslib'), 'test',
                         'manifest_tests', 'example1.xml')
        self._subtest_parse_example1(parse_file(_Manifest(), p))

        p = os.path.join(roslib.packages.get_pkg_dir('test_roslib'), 'test',
                         'manifest_tests', 'stack_example1.xml')
        self._subtest_parse_stack_example1(parse_file(_Manifest('stack'), p))
コード例 #6
0
  def test_parse_example1_file(self):
    from roslib.manifestlib import parse_file, _Manifest
    p = os.path.join(get_test_path(), 'manifest_tests', 'example1.xml')
    self._subtest_parse_example1(parse_file(_Manifest(), p))
    
    p = os.path.join(get_test_path(), 'manifest_tests', 'stack_example1.xml')
    self._subtest_parse_stack_example1(parse_file(_Manifest('stack'), p))

    p = os.path.join(get_test_path(), 'manifest_tests', 'stack_version.xml')
    self._subtest_parse_stack_version(parse_file(_Manifest('stack'), p))
コード例 #7
0
    def test_parse_example1_file(self):
        from roslib.manifestlib import parse_file, _Manifest
        p = os.path.join(get_test_path(), 'manifest_tests', 'example1.xml')
        self._subtest_parse_example1(parse_file(_Manifest(), p))

        p = os.path.join(get_test_path(), 'manifest_tests', 'stack_example1.xml')
        self._subtest_parse_stack_example1(parse_file(_Manifest('stack'), p))

        p = os.path.join(get_test_path(), 'manifest_tests', 'stack_version.xml')
        self._subtest_parse_stack_version(parse_file(_Manifest('stack'), p))
コード例 #8
0
 def test_parse_bad_file(self):
   from roslib.manifestlib import parse_file, _Manifest, ManifestException
   base_p = os.path.join(get_test_path(), 'manifest_tests')
   m = _Manifest()
   for b in ['bad1.xml', 'bad2.xml', 'bad3.xml']:
     p = os.path.join(base_p, b)
     try:
       parse_file(m, p)
       self.fail("parse should have failed on bad manifest")
     except ManifestException, e:
       print str(e)
       self.assert_(b in str(e), "file name should be in error message [%s]"%(str(e)))
コード例 #9
0
 def test_parse_bad_file(self):
     from roslib.manifestlib import parse_file, _Manifest, ManifestException
     base_p = os.path.join(get_test_path(), 'manifest_tests')
     m = _Manifest()
     for b in ['bad1.xml', 'bad2.xml', 'bad3.xml']:
         p = os.path.join(base_p, b)
         try:
             parse_file(m, p)
             self.fail('parse should have failed on bad manifest')
         except ManifestException as e:
             print(str(e))
             self.assert_(b in str(e), 'file name should be in error message [%s]' % (str(e)))
コード例 #10
0
 def test_parse_bad_file(self):
     from roslib.manifestlib import parse_file, _Manifest, ManifestException
     my_dir = roslib.packages.get_pkg_dir('test_roslib')
     base_p = os.path.join(my_dir, 'test', 'manifest_tests')
     m = _Manifest()
     for b in ['bad1.xml', 'bad2.xml', 'bad3.xml']:
         p = os.path.join(base_p, b)
         try:
             parse_file(m, p)
             self.fail("parse should have failed on bad manifest")
         except ManifestException, e:
             print str(e)
             self.assert_(
                 b in str(e),
                 "file name should be in error message [%s]" % (str(e)))
コード例 #11
0
 def test_parse_example1_string(self):
   from roslib.manifestlib import parse, _Manifest
   self._subtest_parse_stack_example1(parse(_Manifest('stack'), STACK_EXAMPLE1))
コード例 #12
0
ファイル: test_roslib_manifestlib.py プロジェクト: jonrf1/ros
 def test_Manifest_str(self):
     # just make sure it doesn't crash
     from roslib.manifestlib import parse, _Manifest
     str(parse(_Manifest(), EXAMPLE1))
コード例 #13
0
ファイル: test_roslib_manifestlib.py プロジェクト: jonrf1/ros
 def test_parse_example1_string(self):
     from roslib.manifestlib import parse, _Manifest
     self._subtest_parse_example1(parse(_Manifest(), EXAMPLE1))
     self._subtest_parse_stack_example1(
         parse(_Manifest('stack'), STACK_EXAMPLE1))
コード例 #14
0
 def test_Manifest_str(self):
   # just make sure it doesn't crash
   from roslib.manifestlib import parse, _Manifest
   str(parse(_Manifest(), EXAMPLE1))