freebsd-ports/security/py-certbot/files/patch-tests_cli__test.py
Danilo G. Baio 3b1494205f security/py-[acme|certbot]: Update to 1.13.0
Changelog:	https://github.com/certbot/certbot/blob/v1.13.0/certbot/CHANGELOG.md

PR:		253224
Submitted by:	Yasuhiro KIMURA <yasu@utahime.org>
Approved by:	python (with hat)
2021-03-07 16:51:45 +00:00

30 lines
1.5 KiB
Python

# See files/patch-certbot-compat-misc.py
--- tests/cli_test.py.orig 2021-03-02 21:37:04 UTC
+++ tests/cli_test.py
@@ -1,6 +1,7 @@
"""Tests for certbot._internal.cli."""
import argparse
import copy
+import sys
from importlib import reload as reload_module
import io
import tempfile
@@ -62,9 +63,14 @@ class FlagDefaultTest(unittest.TestCase):
def test_default_directories(self):
if os.name != 'nt':
- self.assertEqual(cli.flag_default('config_dir'), '/etc/letsencrypt')
- self.assertEqual(cli.flag_default('work_dir'), '/var/lib/letsencrypt')
- self.assertEqual(cli.flag_default('logs_dir'), '/var/log/letsencrypt')
+ if sys.platform.startswith('freebsd') or sys.platform.startswith('dragonfly'):
+ self.assertEqual(cli.flag_default('config_dir'), '/usr/local/etc/letsencrypt')
+ self.assertEqual(cli.flag_default('work_dir'), '/var/db/letsencrypt')
+ self.assertEqual(cli.flag_default('logs_dir'), '/var/log/letsencrypt')
+ else:
+ self.assertEqual(cli.flag_default('config_dir'), '/etc/letsencrypt')
+ self.assertEqual(cli.flag_default('work_dir'), '/var/lib/letsencrypt')
+ self.assertEqual(cli.flag_default('logs_dir'), '/var/log/letsencrypt')
else:
self.assertEqual(cli.flag_default('config_dir'), 'C:\\Certbot')
self.assertEqual(cli.flag_default('work_dir'), 'C:\\Certbot\\lib')