Remove redundant file checks and update test assertions for publisher-specific file paths

- Eliminate obsolete assertions for the root `file` directory as it is no longer created.
- Update tests to validate file paths in `publisher`-specific directories, aligning with the updated repository structure.
- Simplify `create_directories` by removing unnecessary `file` directory creation.
This commit is contained in:
Till Wegmueller 2025-07-31 00:29:53 +02:00
parent 99dd0fe87c
commit fc00304038
No known key found for this signature in database
4 changed files with 2 additions and 7 deletions

View file

@ -1737,7 +1737,6 @@ impl FileBackend {
fn create_directories(&self) -> Result<()> {
// Create the main repository directories
fs::create_dir_all(self.path.join("publisher"))?;
fs::create_dir_all(self.path.join("file"))?;
fs::create_dir_all(self.path.join("index"))?;
fs::create_dir_all(self.path.join("trans"))?;
fs::create_dir_all(self.path.join("obsoleted"))?;

View file

@ -182,7 +182,6 @@ mod tests {
// Check that the repository was created
assert!(repo_path.exists());
assert!(repo_path.join("publisher").exists());
assert!(repo_path.join("file").exists());
assert!(repo_path.join("index").exists());
assert!(repo_path.join("trans").exists());
assert!(repo_path.join(REPOSITORY_CONFIG_FILENAME).exists());
@ -270,8 +269,8 @@ mod tests {
let manifest_path = manifest_dir.join("example.p5m");
publish_package(&mut repo, &manifest_path, &prototype_dir, "test").unwrap();
// Check that the files were published
assert!(repo_path.join("file").exists());
// Check that the files were published in the publisher-specific directory
assert!(repo_path.join("publisher").join("test").join("file").exists());
// Get repository information
let repo_info = repo.get_info().unwrap();

View file

@ -136,9 +136,7 @@ mod e2e_tests {
// Check that the repository was created
assert!(repo_path.exists());
assert!(repo_path.join("publisher").exists());
assert!(repo_path.join("file").exists());
assert!(repo_path.join("index").exists());
assert!(repo_path.join("pkg").exists());
assert!(repo_path.join("trans").exists());
assert!(repo_path.join("pkg6.repository").exists());

View file

@ -48,7 +48,6 @@ mod tests {
// Check that the repository was created
assert!(repo_path.exists());
assert!(repo_path.join("publisher").exists());
assert!(repo_path.join("file").exists());
assert!(repo_path.join("index").exists());
assert!(repo_path.join("trans").exists());
assert!(repo_path.join(REPOSITORY_CONFIG_FILENAME).exists());