Exemplo n.º 1
0
 def test_parses_version(self):
     self.desc = _parse_requirement('pytz==2012d')
     self.assertEqual(
         self.desc, default_desc(
             project_name="pytz",
             specifiers='==2012d',
         ))
Exemplo n.º 2
0
 def test_can_parse_package_no_version(self):
     self.desc = _parse_requirement("codecov")
     self.assertEqual(self.desc,
                      default_desc(
                          type="pypi",
                          project_name="codecov",
                      ))
Exemplo n.º 3
0
 def test_cannonical_1(self):
     self.desc = _parse_requirement("pymongo==2.8")
     self.assertEqual(
         self.desc,
         default_desc(
             type="pypi",
             project_name="pymongo",
             specifiers="==2.8",
         ))
Exemplo n.º 4
0
 def test_can_parse(self):
     self.desc = _parse_requirement(
         "backports.shutil-get-terminal-size==1.0.0")
     self.assertEqual(
         self.desc,
         default_desc(
             type="pypi",
             project_name="backports.shutil-get-terminal-size",
             specifiers="==1.0.0",
         ))
Exemplo n.º 5
0
 def test_can_parse_mercurial(self):
     repo_link = "hg+https://myrepo/hg/MyApp#egg=MyApp"
     self.desc = _parse_requirement(repo_link)
     self.assertEqual(
         self.desc,
         default_desc(
             project_name="MyApp",
             type="version_control",
             link=repo_link,
             version_control=dict(
                 type="hg",
                 protocol="https",
                 location="https://myrepo/hg/MyApp",
                 version=None,
             ),
         ))
Exemplo n.º 6
0
 def test_can_parse_svn(self):
     repo_link = "svn+http://myrepo/svn/MyApp#egg=MyApp"
     self.desc = _parse_requirement(repo_link)
     self.assertEqual(
         self.desc,
         default_desc(
             project_name="MyApp",
             type="version_control",
             link=repo_link,
             version_control=dict(
                 type='svn',
                 protocol='http',
                 location="http://myrepo/svn/MyApp",
                 version=None,
             ),
         ))
Exemplo n.º 7
0
 def test_git_branch(self):
     repo_link = "git+git://github.com/tornadoweb/[email protected]" \
         "#egg=tornado"
     self.desc = _parse_requirement(repo_link)
     self.assertEqual(
         self.desc,
         default_desc(
             project_name="tornado",
             type="version_control",
             link=repo_link,
             version_control=dict(
                 type="git",
                 protocol="git",
                 location="git://github.com/tornadoweb/tornado.git",
                 version="branch4.5.1",
             ),
         ))
Exemplo n.º 8
0
 def test_two_versions(self):
     repo_link = "git+git://github.com/svrana/pipsqueak.git@" \
         "7f9405aaf3935aa4569a803#egg=pipsqueak== 0.1.0"
     self.desc = _parse_requirement(repo_link)
     self.assertEqual(
         self.desc,
         default_desc(
             project_name="pipsqueak",
             link=repo_link,
             version_control=dict(
                 type="git",
                 protocol="git",
                 location="git://github.com/svrana/pipsqueak.git",
                 version="7f9405aaf3935aa4569a803",
             ),
             specifiers="==0.1.0",
         ))
Exemplo n.º 9
0
 def test_e_git_egg(self):
     repo_link = "git+git://github.com/ContextLogic/wheezy-captcha.git" \
         "#egg=wheezy.captcha"
     self.desc = _parse_requirement("-e {}".format(repo_link))
     self.assertEqual(
         self.desc,
         default_desc(
             project_name="wheezy.captcha",
             editable=True,
             link=repo_link,
             version_control=dict(
                 type="git",
                 protocol="git",
                 location="git://github.com/ContextLogic/wheezy-captcha.git",
                 version=None,
             ),
         ))