test_requirements.py
Go to the documentation of this file.
00001 # Software License Agreement (GPL)
00002 #
00003 # \file      test_requirements.py
00004 # \authors   Paul Bovbel <pbovbel@locusrobotics.com>
00005 # \copyright Copyright (c) (2017,), Locus Robotics, All rights reserved.
00006 #
00007 # This program is free software: you can redistribute it and/or
00008 # modify it under the terms of the GNU General Public License as
00009 # published by the Free Software Foundation, either version 2 of the
00010 # License, or (at your option) any later version.
00011 #
00012 # This program is distributed in the hope that it will be useful, but
00013 # WITHOUT ANY WARRANTY; without even the implied warranty of
00014 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
00015 # General Public License for more details.
00016 #
00017 # You should have received a copy of the GNU General Public License
00018 # along with this program. If not, see <http://www.gnu.org/licenses/>.
00019 import unittest
00020 
00021 from catkin_virtualenv.requirements import VcsRequirement
00022 from packaging.requirements import InvalidRequirement
00023 
00024 
00025 class TestRequirements(unittest.TestCase):
00026 
00027     def test_vcs_requirement_parse(self):
00028         string = "git+git://github.com/pytransitions/transitions@dev-async#egg=transitions"
00029         req = VcsRequirement(string)
00030         self.assertEqual(req.name, "transitions")
00031 
00032     def test_vcs_requirement_parse_no_name(self):
00033         string = "git+git://github.com/pytransitions/transitions@dev-async"
00034         with self.assertRaises(InvalidRequirement):
00035             _ = VcsRequirement(string)
00036 
00037     def test_vcs_requirement_parse_invalid(self):
00038         string = "asdf"
00039         with self.assertRaises(InvalidRequirement):
00040             _ = VcsRequirement(string)


catkin_virtualenv
Author(s): Paul Bovbel
autogenerated on Thu Jun 27 2019 20:04:50