Skip to content

Commit 8104dd7

Browse files
committed
address review feedback: remove redundant root.json writes, rename docs section
1 parent c49bdb9 commit 8104dd7

File tree

6 files changed

+4
-18
lines changed

6 files changed

+4
-18
lines changed

docs/INSTALLATION.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ from GitHub, change into the project root directory, and install with pip
5353
python3 -m pip install -r requirements/dev.txt
5454

5555

56-
Bootstrap root metadata
57-
-----------------------
56+
Application deployment
57+
----------------------
5858

5959
The initial trusted root metadata (``root.json``) is the trust anchor for all
6060
subsequent metadata verification. Applications should deploy a trusted root

tests/test_updater_consistent_snapshot.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,6 @@ def _init_repo(
7474
sim.publish_root()
7575
sim.prefix_targets_with_hash = prefix_targets
7676

77-
# Init trusted root with the latest consistent_snapshot
78-
with open(os.path.join(self.metadata_dir, "root.json"), "bw") as f:
79-
f.write(sim.signed_roots[-1])
80-
8177
return sim
8278

8379
def _init_updater(self) -> Updater:

tests/test_updater_delegation_graphs.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,6 @@ def _init_repo(self, test_case: DelegationsTestCase) -> None:
120120

121121
def _init_updater(self) -> Updater:
122122
"""Create a new Updater instance"""
123-
# Init trusted root for Updater
124-
with open(os.path.join(self.metadata_dir, "root.json"), "bw") as f:
125-
f.write(self.sim.signed_roots[0])
126-
127123
return Updater(
128124
self.metadata_dir,
129125
"https://example.com/metadata/",

tests/test_updater_fetch_target.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,8 @@ def setUp(self) -> None:
4040
os.mkdir(self.metadata_dir)
4141
os.mkdir(self.targets_dir)
4242

43-
# Setup the repository, bootstrap client root.json
43+
# Setup the repository
4444
self.sim = RepositorySimulator()
45-
with open(os.path.join(self.metadata_dir, "root.json"), "bw") as f:
46-
f.write(self.sim.signed_roots[0])
4745

4846
if self.dump_dir is not None:
4947
# create test specific dump directory

tests/test_updater_key_rotations.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,6 @@ def _run_refresh(self) -> None:
7272

7373
# bootstrap with initial root
7474
self.metadata_dir = tempfile.mkdtemp(dir=self.temp_dir.name)
75-
with open(os.path.join(self.metadata_dir, "root.json"), "bw") as f:
76-
f.write(self.sim.signed_roots[0])
7775

7876
updater = Updater(
7977
self.metadata_dir,

tests/test_updater_validation.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,8 @@ def setUp(self) -> None:
2323
os.mkdir(self.metadata_dir)
2424
os.mkdir(self.targets_dir)
2525

26-
# Setup the repository, bootstrap client root.json
26+
# Setup the repository
2727
self.sim = RepositorySimulator()
28-
with open(os.path.join(self.metadata_dir, "root.json"), "bw") as f:
29-
f.write(self.sim.signed_roots[0])
3028

3129
def tearDown(self) -> None:
3230
self.temp_dir.cleanup()

0 commit comments

Comments
 (0)