Skip to content

Commit

Permalink
Add a test condition for the previously added feature for issue #319
Browse files Browse the repository at this point in the history
  • Loading branch information
vladimir-v-diaz committed Nov 10, 2016
1 parent a98f2b6 commit 0e34e06
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/test_repository_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -1042,6 +1042,14 @@ def test_add_target(self):
self.assertEqual(self.targets_object.target_files['/file2.txt'],
custom_file_permissions)

# Attempt to replace target that has already been added.
octal_file_permissions2 = oct(os.stat(target_filepath).st_mode)[4:]
custom_file_permissions2 = {'file_permissions': octal_file_permissions}
self.targets_object.add_target(target2_filepath, custom_file_permissions2)
self.assertEqual(self.targets_object.target_files['/file2.txt'],
custom_file_permissions2)


# Test improperly formatted arguments.
self.assertRaises(tuf.ssl_commons.exceptions.FormatError, self.targets_object.add_target, 3)
self.assertRaises(tuf.ssl_commons.exceptions.FormatError, self.targets_object.add_target, 3,
Expand Down

0 comments on commit 0e34e06

Please sign in to comment.