From 958825c81feb59e7833daed189c9315b3cfb113f Mon Sep 17 00:00:00 2001 From: sydneyli Date: Tue, 10 Dec 2019 13:38:38 -0800 Subject: [PATCH] parsernode_test: testfix --- certbot-apache/certbot_apache/configurator.py | 2 +- certbot-apache/certbot_apache/tests/augeasnode_test.py | 6 +++--- certbot-apache/certbot_apache/tests/dualnode_test.py | 2 +- certbot-apache/certbot_apache/tests/parsernode_test.py | 10 +++++----- .../certbot_apache/tests/parsernode_util_test.py | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/certbot-apache/certbot_apache/configurator.py b/certbot-apache/certbot_apache/configurator.py index b5ae5b18f..8aa35ed45 100644 --- a/certbot-apache/certbot_apache/configurator.py +++ b/certbot-apache/certbot_apache/configurator.py @@ -368,7 +368,7 @@ class ApacheConfigurator(common.Installer): return dualparser.DualBlockNode( name=assertions.PASS, - ancestors=tuple(), + ancestors=(), filepath=self.parser.loc["root"], metadata=metadata ) diff --git a/certbot-apache/certbot_apache/tests/augeasnode_test.py b/certbot-apache/certbot_apache/tests/augeasnode_test.py index 34d8a8505..d0f5473d7 100644 --- a/certbot-apache/certbot_apache/tests/augeasnode_test.py +++ b/certbot-apache/certbot_apache/tests/augeasnode_test.py @@ -36,7 +36,7 @@ class AugeasParserNodeTest(util.ApacheTest): # pylint: disable=too-many-public- from certbot_apache.augeasparser import AugeasBlockNode block = AugeasBlockNode( name=assertions.PASS, - ancestors=tuple(), + ancestors=(), filepath=assertions.PASS, metadata={"augeasparser": mock.Mock(), "augeaspath": "/files/anything"} ) @@ -244,7 +244,7 @@ class AugeasParserNodeTest(util.ApacheTest): # pylint: disable=too-many-public- from certbot_apache.augeasparser import AugeasBlockNode parameters = { "name": assertions.PASS, - "ancestors": tuple(), + "ancestors": (), "filepath": assertions.PASS, "metadata": { "augeasparser": mock.Mock(), @@ -261,7 +261,7 @@ class AugeasParserNodeTest(util.ApacheTest): # pylint: disable=too-many-public- from certbot_apache.augeasparser import AugeasBlockNode parameters = { "name": assertions.PASS, - "ancestors": tuple(), + "ancestors": (), "filepath": assertions.PASS, "metadata": { "augeasparser": mock.Mock(), diff --git a/certbot-apache/certbot_apache/tests/dualnode_test.py b/certbot-apache/certbot_apache/tests/dualnode_test.py index 92fd7485d..1f42308ac 100644 --- a/certbot-apache/certbot_apache/tests/dualnode_test.py +++ b/certbot-apache/certbot_apache/tests/dualnode_test.py @@ -17,7 +17,7 @@ class DualParserNodeTest(unittest.TestCase): # pylint: disable=too-many-public- parser_mock.get_arg.return_value = [] self.metadata = {"augeasparser": parser_mock, "augeaspath": "/invalid", "ac_ast": None} self.block = dualparser.DualBlockNode(name="block", - ancestors=tuple(), + ancestors=(), filepath="/tmp/something", metadata=self.metadata) self.block_two = dualparser.DualBlockNode(name="block", diff --git a/certbot-apache/certbot_apache/tests/parsernode_test.py b/certbot-apache/certbot_apache/tests/parsernode_test.py index a6caf4814..c3e0cc379 100644 --- a/certbot-apache/certbot_apache/tests/parsernode_test.py +++ b/certbot-apache/certbot_apache/tests/parsernode_test.py @@ -13,8 +13,8 @@ class DummyParserNode(interfaces.ParserNode): """ Initializes the ParserNode instance. """ - ancestor, dirty, filepath, metadata = util.parsernode_kwargs(kwargs) - self.ancestor = ancestor + ancestors, dirty, filepath, metadata = util.parsernode_kwargs(kwargs) + self.ancestors = ancestors self.dirty = dirty self.filepath = filepath self.metadata = metadata @@ -108,18 +108,18 @@ class ParserNodeTest(unittest.TestCase): dummyblock = DummyBlockNode( name="None", parameters=(), - ancestor=None, + ancestors=(), dirty=False, filepath="/some/random/path" ) dummydirective = DummyDirectiveNode( name="Name", - ancestor=None, + ancestors=(), filepath="/another/path" ) dummycomment = DummyCommentNode( comment="Comment", - ancestor=dummyblock, + ancestors=(dummyblock,), filepath="/some/file" ) diff --git a/certbot-apache/certbot_apache/tests/parsernode_util_test.py b/certbot-apache/certbot_apache/tests/parsernode_util_test.py index 93b98a94f..bb3974f0f 100644 --- a/certbot-apache/certbot_apache/tests/parsernode_util_test.py +++ b/certbot-apache/certbot_apache/tests/parsernode_util_test.py @@ -10,7 +10,7 @@ class ParserNodeUtilTest(unittest.TestCase): def _setup_parsernode(self): """ Sets up kwargs dict for ParserNode """ return { - "ancestors": tuple(), + "ancestors": (), "dirty": False, "filepath": "/tmp", }