2016-11-29 11:43:03 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
|
|
|
|
|
|
|
import os
|
|
|
|
import subprocess
|
|
|
|
import sys
|
|
|
|
|
2017-12-04 13:14:30 +00:00
|
|
|
import six
|
|
|
|
|
2016-11-29 11:43:03 +00:00
|
|
|
|
|
|
|
HERE = os.path.abspath(os.path.dirname(__file__))
|
|
|
|
BINDIR = os.path.join(HERE, '../bin')
|
|
|
|
PUNGI_CONFIG_VALIDATE = os.path.join(BINDIR, 'pungi-config-validate')
|
|
|
|
|
|
|
|
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
|
|
|
|
|
|
|
|
from tests import helpers
|
|
|
|
|
|
|
|
|
|
|
|
class ConfigValidateScriptTest(helpers.PungiTestCase):
|
|
|
|
|
2018-02-06 21:29:22 +00:00
|
|
|
def test_validate_dummy_config(self):
|
2016-11-29 11:43:03 +00:00
|
|
|
DUMMY_CONFIG = os.path.join(HERE, 'data/dummy-pungi.conf')
|
2017-12-04 13:14:30 +00:00
|
|
|
interp = 'python2' if six.PY2 else 'python3'
|
|
|
|
p = subprocess.Popen([interp, PUNGI_CONFIG_VALIDATE, DUMMY_CONFIG],
|
2016-11-29 11:43:03 +00:00
|
|
|
stdout=subprocess.PIPE,
|
|
|
|
stderr=subprocess.PIPE)
|
|
|
|
(stdout, stderr) = p.communicate()
|
2017-09-05 08:01:21 +00:00
|
|
|
self.assertEqual(b'', stdout)
|
|
|
|
self.assertEqual(b'', stderr)
|
2016-11-29 11:43:03 +00:00
|
|
|
self.assertEqual(0, p.returncode)
|