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-nginx/tests/parser_obj_test.py')
-rw-r--r--certbot-nginx/tests/parser_obj_test.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/certbot-nginx/tests/parser_obj_test.py b/certbot-nginx/tests/parser_obj_test.py
index 8262c5f52..4d1f25277 100644
--- a/certbot-nginx/tests/parser_obj_test.py
+++ b/certbot-nginx/tests/parser_obj_test.py
@@ -35,8 +35,8 @@ class CommentHelpersTest(unittest.TestCase):
self.assertTrue(_is_certbot_comment(comment))
self.assertEqual(comment.dump(), COMMENT_BLOCK)
self.assertEqual(comment.dump(True), [' '] + COMMENT_BLOCK)
- self.assertEqual(_certbot_comment(None, 2).dump(True),
- [' '] + COMMENT_BLOCK)
+ self.assertEqual(_certbot_comment(None, 2).dump(True), [' '] + COMMENT_BLOCK)
+
class ParsingHooksTest(unittest.TestCase):
def test_is_sentence(self):
@@ -94,6 +94,7 @@ class ParsingHooksTest(unittest.TestCase):
parse_raw([], add_spaces=True)
fake_parser1.parse.called_with([None, True])
+
class SentenceTest(unittest.TestCase):
def setUp(self):
from certbot_nginx._internal.parser_obj import Sentence
@@ -140,6 +141,7 @@ class SentenceTest(unittest.TestCase):
self.sentence.parse(['\n\t \n', 'tabs'])
self.assertEqual(self.sentence.get_tabs(), '')
+
class BlockTest(unittest.TestCase):
def setUp(self):
from certbot_nginx._internal.parser_obj import Block
@@ -244,8 +246,8 @@ class StatementsTest(unittest.TestCase):
def test_parse_hides_trailing_whitespace(self):
self.statements.parse(self.raw + ['\n\n '])
- self.assertTrue(isinstance(self.statements.dump()[-1], list))
- self.assertTrue(self.statements.dump(True)[-1].isspace())
+ self.assertIsInstance(self.statements.dump()[-1], list)
+ self.assertIs(self.statements.dump(True)[-1].isspace(), True)
self.assertEqual(self.statements.dump(True)[-1], '\n\n ')
def test_iterate(self):
@@ -254,5 +256,6 @@ class StatementsTest(unittest.TestCase):
for i, elem in enumerate(self.statements.iterate(match=lambda x: 'sentence' in x)):
self.assertEqual(expected[i], elem.dump())
+
if __name__ == "__main__":
unittest.main() # pragma: no cover