mirror of
https://github.com/lilydjwg/nvchecker
synced 2025-02-07 14:01:38 +00:00
Add testcases for VCS source
This commit is contained in:
parent
5bde44a3c2
commit
ce9819f49d
@ -27,7 +27,7 @@ def _parse_oldver(oldver):
|
||||
|
||||
def get_version(name, conf, callback):
|
||||
vcs = conf['vcs']
|
||||
oldver = conf['oldver']
|
||||
oldver = conf.get('oldver')
|
||||
cmd = _cmd_prefix + [name, vcs]
|
||||
p = tornado.process.Subprocess(cmd, io_loop=IOLoop.instance(),
|
||||
stdout=tornado.process.Subprocess.STREAM)
|
||||
|
18
tests/test_vcs.py
Normal file
18
tests/test_vcs.py
Normal file
@ -0,0 +1,18 @@
|
||||
import os
|
||||
import shutil
|
||||
import pytest
|
||||
from tests.helper import ExternalVersionTestCase
|
||||
|
||||
|
||||
class VCSTest(ExternalVersionTestCase):
|
||||
@pytest.mark.skipif(shutil.which("git") is None,
|
||||
reason="requires git command")
|
||||
def test_git(self):
|
||||
os.path.exists("example") or os.mkdir("example")
|
||||
self.assertEqual(self.sync_get_version("example", {"vcs": "git+https://github.com/harry-sanabria/ReleaseTestRepo.git"}), "1.1.2b3cdf6134b07ae6ac77f11b586dc1ae6d1521db")
|
||||
|
||||
@pytest.mark.skipif(shutil.which("hg") is None,
|
||||
reason="requires hg command")
|
||||
def test_mercurial(self):
|
||||
os.path.exists("example") or os.mkdir("example")
|
||||
self.assertEqual(self.sync_get_version("example", {"vcs": "hg+https://bitbucket.org/pil0t/testrepo"}), "1.1.84679e29c7d9")
|
Loading…
Reference in New Issue
Block a user