mirror of
https://github.com/theupdateframework/python-tuf
synced 2026-05-24 10:08:28 +00:00
Merge pull request #1715 from jku/tests-sim-updater-bootstrap
tests: Refactor client bootstrap
This commit is contained in:
commit
bdf1cbbbb5
3 changed files with 4 additions and 12 deletions
|
|
@ -50,10 +50,7 @@ def _init_repo(
|
|||
|
||||
# Init trusted root with the latest consistent_snapshot
|
||||
with open(os.path.join(self.metadata_dir, "root.json"), "bw") as f:
|
||||
root = sim.download_bytes(
|
||||
"https://example.com/metadata/2.root.json", 100000
|
||||
)
|
||||
f.write(root)
|
||||
f.write(sim.signed_roots[-1])
|
||||
|
||||
return sim
|
||||
|
||||
|
|
|
|||
|
|
@ -49,11 +49,9 @@ def setUp(self) -> None:
|
|||
|
||||
self.sim = RepositorySimulator()
|
||||
|
||||
# boostrap client with initial root metadata
|
||||
with open(os.path.join(self.metadata_dir, "root.json"), "bw") as f:
|
||||
root = self.sim.download_bytes(
|
||||
"https://example.com/metadata/1.root.json", 100000
|
||||
)
|
||||
f.write(root)
|
||||
f.write(self.sim.signed_roots[0])
|
||||
|
||||
def tearDown(self) -> None:
|
||||
self.temp_dir.cleanup()
|
||||
|
|
|
|||
|
|
@ -38,10 +38,7 @@ def setUp(self) -> None:
|
|||
# Setup the repository, bootstrap client root.json
|
||||
self.sim = RepositorySimulator()
|
||||
with open(os.path.join(self.metadata_dir, "root.json"), "bw") as f:
|
||||
root = self.sim.download_bytes(
|
||||
"https://example.com/metadata/1.root.json", 100000
|
||||
)
|
||||
f.write(root)
|
||||
f.write(self.sim.signed_roots[0])
|
||||
|
||||
if self.dump_dir is not None:
|
||||
# create test specific dump directory
|
||||
|
|
|
|||
Loading…
Reference in a new issue