Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/certbot/certbot.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'certbot/plugins/webroot_test.py')
-rw-r--r--certbot/plugins/webroot_test.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/certbot/plugins/webroot_test.py b/certbot/plugins/webroot_test.py
index 59133f0aa..5303fe4da 100644
--- a/certbot/plugins/webroot_test.py
+++ b/certbot/plugins/webroot_test.py
@@ -4,9 +4,9 @@ from __future__ import print_function
import argparse
import errno
+import json
import os
import shutil
-import stat
import tempfile
import unittest
@@ -17,6 +17,7 @@ import six
from acme import challenges
from certbot import achallenges
+from certbot import compat
from certbot import errors
from certbot.display import util as display_util
@@ -142,6 +143,7 @@ class AuthenticatorTest(unittest.TestCase):
self.assertRaises(errors.PluginError, self.auth.perform, [])
os.chmod(self.path, 0o700)
+ @test_util.skip_on_windows('On Windows, there is no chown.')
@mock.patch("certbot.plugins.webroot.os.chown")
def test_failed_chown(self, mock_chown):
mock_chown.side_effect = OSError(errno.EACCES, "msg")
@@ -169,16 +171,14 @@ class AuthenticatorTest(unittest.TestCase):
# Remove exec bit from permission check, so that it
# matches the file
self.auth.perform([self.achall])
- path_permissions = stat.S_IMODE(os.stat(self.validation_path).st_mode)
- self.assertEqual(path_permissions, 0o644)
+ self.assertTrue(compat.compare_file_modes(os.stat(self.validation_path).st_mode, 0o644))
# Check permissions of the directories
for dirpath, dirnames, _ in os.walk(self.path):
for directory in dirnames:
full_path = os.path.join(dirpath, directory)
- dir_permissions = stat.S_IMODE(os.stat(full_path).st_mode)
- self.assertEqual(dir_permissions, 0o755)
+ self.assertTrue(compat.compare_file_modes(os.stat(full_path).st_mode, 0o755))
parent_gid = os.stat(self.path).st_gid
parent_uid = os.stat(self.path).st_uid
@@ -274,7 +274,7 @@ class WebrootActionTest(unittest.TestCase):
def test_webroot_map_action(self):
args = self.parser.parse_args(
- ["--webroot-map", '{{"thing.com":"{0}"}}'.format(self.path)])
+ ["--webroot-map", json.dumps({'thing.com': self.path})])
self.assertEqual(args.webroot_map["thing.com"], self.path)
def test_domain_before_webroot(self):