2016-11-29 11:43:03 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
|
|
|
|
2019-12-06 02:54:11 +00:00
|
|
|
import mock
|
2016-11-29 11:43:03 +00:00
|
|
|
import os
|
|
|
|
import subprocess
|
|
|
|
import sys
|
2019-12-06 02:54:11 +00:00
|
|
|
import six
|
2016-11-29 11:43:03 +00:00
|
|
|
|
2019-12-06 02:54:11 +00:00
|
|
|
from pungi.scripts.config_validate import cli_main
|
|
|
|
from tests import helpers
|
2016-11-29 11:43:03 +00:00
|
|
|
|
|
|
|
|
2019-12-06 02:54:11 +00:00
|
|
|
HERE = os.path.abspath(os.path.dirname(__file__))
|
|
|
|
DUMMY_CONFIG = os.path.join(HERE, 'data/dummy-pungi.conf')
|
2016-11-29 11:43:03 +00:00
|
|
|
|
|
|
|
|
|
|
|
class ConfigValidateScriptTest(helpers.PungiTestCase):
|
|
|
|
|
2019-12-06 02:54:11 +00:00
|
|
|
@mock.patch('sys.argv', new=['pungi-config-validate', DUMMY_CONFIG])
|
|
|
|
@mock.patch('sys.stderr', new_callable=six.StringIO)
|
|
|
|
@mock.patch('sys.stdout', new_callable=six.StringIO)
|
|
|
|
def test_validate_dummy_config(self, stdout, stderr):
|
|
|
|
cli_main()
|
|
|
|
self.assertEqual('', stdout.getvalue())
|
|
|
|
self.assertEqual('', stderr.getvalue())
|