Add a first test. Remove unused import

This commit is contained in:
Adrien Ferrand 2019-04-17 12:33:50 +02:00
parent 3dca99f211
commit e822f8a4ad
2 changed files with 22 additions and 1 deletions

View file

@ -8,7 +8,6 @@ import six
from acme import challenges
from certbot import achallenges
from certbot.compat import os
from certbot.compat import security
from certbot.tests import acme_util
from certbot.tests import util as test_util

View file

@ -0,0 +1,22 @@
"""Unit test for security module."""
from certbot.compat import os
from certbot.compat import security
from certbot.tests.util import TempDirTestCase
class SecurityTest(TempDirTestCase):
"""Unit tests for security module."""
def test_check_modes(self):
probe = os.path.join(self.tempdir, 'probe')
open(probe, 'w').close()
security.chmod(probe, 0o755)
# TODO: add assertion when check_mode is implemented
#self.assertTrue(security.check_mode(probe, 0o755))
security.chmod(probe, 0o700)
# TODO: add assertion when check_mode is implemented
#self.assertFalse(security.check_mode(probe, 0o755))