mirror of
https://github.com/theupdateframework/python-tuf
synced 2026-05-24 10:08:28 +00:00
tests: Make sure tests can execute from root source dir
"python -m unittest" now works in the root source dir too Signed-off-by: Jussi Kukkonen <jkukkonen@google.com>
This commit is contained in:
parent
28a031f039
commit
9946dc5277
2 changed files with 8 additions and 5 deletions
|
|
@ -56,9 +56,6 @@
|
|||
signers.append(CryptoSigner(private_key, key))
|
||||
|
||||
EXPIRY = datetime(2050, 1, 1, tzinfo=timezone.utc)
|
||||
OUT_DIR = "generated_data/ed25519_metadata"
|
||||
if not os.path.exists(OUT_DIR):
|
||||
os.mkdir(OUT_DIR)
|
||||
|
||||
SERIALIZER = JSONSerializer()
|
||||
|
||||
|
|
@ -103,7 +100,12 @@ def generate_all_files(
|
|||
for i, md in enumerate([md_root, md_timestamp, md_snapshot, md_targets]):
|
||||
assert isinstance(md, Metadata)
|
||||
md.sign(signers[i])
|
||||
path = os.path.join(OUT_DIR, f"{md.signed.type}_with_ed25519.json")
|
||||
path = os.path.join(
|
||||
utils.TESTS_DIR,
|
||||
"generated_data",
|
||||
"ed25519_metadata",
|
||||
f"{md.signed.type}_with_ed25519.json",
|
||||
)
|
||||
if verify:
|
||||
verify_generation(md, path)
|
||||
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@
|
|||
"""
|
||||
|
||||
import logging
|
||||
import os
|
||||
import socket
|
||||
import sys
|
||||
import unittest
|
||||
|
|
@ -56,7 +57,7 @@ def test_simple_server_startup(self) -> None:
|
|||
def test_cleanup(self) -> None:
|
||||
# Test normal case
|
||||
server_process_handler = utils.TestServerProcess(
|
||||
log=logger, server="simple_server.py"
|
||||
log=logger, server=os.path.join(utils.TESTS_DIR, "simple_server.py")
|
||||
)
|
||||
|
||||
server_process_handler.clean()
|
||||
|
|
|
|||
Loading…
Reference in a new issue