Skip to content

Commit

Permalink
Fix pylint error E0102 (function-redefined)
Browse files Browse the repository at this point in the history
Remove outdated original function.

Signed-off-by: Lukas Puehringer <[email protected]>
  • Loading branch information
lukpueh committed Oct 20, 2022
1 parent 91ac1f3 commit 32b654b
Showing 1 changed file with 0 additions and 36 deletions.
36 changes: 0 additions & 36 deletions tests/test_keys.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,42 +167,6 @@ def test_format_keyval_to_metadata(self):
)
keyvalue["private"] = private

def test_import_rsakey_from_public_pem(self):
pem = self.rsakey_dict["keyval"]["public"]
rsa_key = KEYS.import_rsakey_from_public_pem(pem)

# Check if the format of the object returned by this function corresponds
# to 'securesystemslib.formats.RSAKEY_SCHEMA' format.
self.assertTrue(securesystemslib.formats.RSAKEY_SCHEMA.matches(rsa_key))

# Verify whitespace is stripped.
self.assertEqual(
rsa_key, KEYS.import_rsakey_from_public_pem(pem + "\n")
)

# Supplying a 'bad_pem' argument.
self.assertRaises(
securesystemslib.exceptions.FormatError,
KEYS.import_rsakey_from_public_pem,
"bad_pem",
)

# Supplying an improperly formatted PEM.
# Strip the PEM header and footer.
pem_header = "-----BEGIN PUBLIC KEY-----"
self.assertRaises(
securesystemslib.exceptions.FormatError,
KEYS.import_rsakey_from_public_pem,
pem[len(pem_header) :],
)

pem_footer = "-----END PUBLIC KEY-----"
self.assertRaises(
securesystemslib.exceptions.FormatError,
KEYS.import_rsakey_from_public_pem,
pem[: -len(pem_footer)],
)

def test_format_metadata_to_key(self):
# Copying self.rsakey_dict so that rsakey_dict remains
# unchanged during and after this test execution.
Expand Down

0 comments on commit 32b654b

Please sign in to comment.