mirror of
https://github.com/certbot/certbot.git
synced 2026-01-23 07:20:55 +03:00
Merge pull request #1871 from letsencrypt/fix_deprecation
Fix flag deprecation
This commit is contained in:
@@ -10,6 +10,8 @@ import stat
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
import configargparse
|
||||
|
||||
from letsencrypt import errors
|
||||
|
||||
|
||||
@@ -278,9 +280,11 @@ def add_deprecated_argument(add_argument, argument_name, nargs):
|
||||
sys.stderr.write(
|
||||
"Use of {0} is deprecated.\n".format(option_string))
|
||||
|
||||
configargparse.ACTION_TYPES_THAT_DONT_NEED_A_VALUE.add(ShowWarning)
|
||||
add_argument(argument_name, action=ShowWarning,
|
||||
help=argparse.SUPPRESS, nargs=nargs)
|
||||
|
||||
|
||||
def check_domain_sanity(domain):
|
||||
"""Method which validates domain value and errors out if
|
||||
the requirements are not met.
|
||||
|
||||
@@ -551,6 +551,11 @@ class CLITest(unittest.TestCase): # pylint: disable=too-many-public-methods
|
||||
self.assertEqual(path, os.path.abspath(path))
|
||||
self.assertEqual(contents, test_contents)
|
||||
|
||||
def test_agree_dev_preview_config(self):
|
||||
with MockedVerb('run') as mocked_run:
|
||||
self._call(['-c', test_util.vector_path('cli.ini')])
|
||||
self.assertTrue(mocked_run.called)
|
||||
|
||||
|
||||
class DetermineAccountTest(unittest.TestCase):
|
||||
"""Tests for letsencrypt.cli._determine_account."""
|
||||
|
||||
1
letsencrypt/tests/testdata/cli.ini
vendored
Normal file
1
letsencrypt/tests/testdata/cli.ini
vendored
Normal file
@@ -0,0 +1 @@
|
||||
agree-dev-preview = True
|
||||
Reference in New Issue
Block a user