Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
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)