diff --git a/tests/test_tutorial.py b/tests/test_tutorial.py index b2633778fd..d6ec024972 100644 --- a/tests/test_tutorial.py +++ b/tests/test_tutorial.py @@ -134,7 +134,8 @@ def test_tutorial(self): repository.root.load_signing_key(private_root_key) repository.root.load_signing_key(private_root_key2) - # Patch logger to assert that it accurately logs dirty roles + # NOTE: The tutorial does not call dirty_roles anymore due to #964 and + # #958. We still call it here to see if roles are dirty as expected. with mock.patch("tuf.repository_tool.logger") as mock_logger: repository.dirty_roles() # Concat strings to avoid Python2/3 unicode prefix problems ('' vs. u'') @@ -186,6 +187,8 @@ def test_tutorial(self): repository.timestamp.expiration = datetime.datetime(2080, 10, 28, 12, 8) + # NOTE: The tutorial does not call dirty_roles anymore due to #964 and + # #958. We still call it here to see if roles are dirty as expected. with mock.patch("tuf.repository_tool.logger") as mock_logger: repository.dirty_roles() # Concat strings to avoid Python2/3 unicode prefix problems ('' vs. u'') @@ -265,7 +268,8 @@ def test_tutorial(self): 'timestamp_key', 'password') repository.timestamp.load_signing_key(private_timestamp_key) - # Patch logger to assert that it accurately logs dirty roles + # NOTE: The tutorial does not call dirty_roles anymore due to #964 and + # #958. We still call it here to see if roles are dirty as expected. with mock.patch("tuf.repository_tool.logger") as mock_logger: repository.dirty_roles() # Concat strings to avoid Python2/3 unicode prefix problems ('' vs. u'') @@ -278,6 +282,8 @@ def test_tutorial(self): self.assertTrue(os.path.exists(os.path.join( 'repository','targets', 'myproject', 'file4.txt'))) + # NOTE: The tutorial does not call dirty_roles anymore due to #964 and + # #958. We still call it here to see if roles are dirty as expected. with mock.patch("tuf.repository_tool.logger") as mock_logger: repository.dirty_roles() # Concat strings to avoid Python2/3 unicode prefix problems ('' vs. u'') @@ -318,7 +324,8 @@ def test_tutorial(self): 'unclaimed_key', 'password') repository.targets("unclaimed").load_signing_key(private_unclaimed_key) - + # NOTE: The tutorial does not call dirty_roles anymore due to #964 and + # #958. We still call it here to see if roles are dirty as expected. with mock.patch("tuf.repository_tool.logger") as mock_logger: repository.dirty_roles() # Concat strings to avoid Python2/3 unicode prefix problems ('' vs. u'') @@ -337,6 +344,7 @@ def test_tutorial(self): # ----- Tutorial Section: Delegate to Hashed Bins + repository.targets('unclaimed').remove_target("myproject/file4.txt") targets = repository.get_filepaths_in_directory( os.path.join('repository', 'targets', 'myproject'), recursive_walk=True) @@ -362,10 +370,11 @@ def test_tutorial(self): ]) - for delegation in repository.targets('unclaimed').delegations: delegation.load_signing_key(private_unclaimed_key) + # NOTE: The tutorial does not call dirty_roles anymore due to #964 and + # #958. We still call it here to see if roles are dirty as expected. with mock.patch("tuf.repository_tool.logger") as mock_logger: repository.dirty_roles() # Concat strings to avoid Python2/3 unicode prefix problems ('' vs. u'')