Repository: borgbackup/borg

Issue:
Strange code in test_unknown_mandatory_feature_in_cache
## Have you checked borgbackup docs, FAQ, and open Github issues?

Yes

## Is this a BUG / ISSUE report or a QUESTION?

ISSUE

## System information. For client/server mode post info for both machines.

#### Your borg version (borg -V).
latest master (e8ff51b0f90b994b3931722a4aaca2c57130126d)

<!--
#### Operating system (distribution) and version.

#### Hardware / network configuration, and filesystems used.

#### How much data is handled by borg?

#### Full borg commandline that lead to the problem (leave away excludes and passwords)
-->

## Describe the problem you're observing.

path_prefix is a str, but it is only used in a boolean context in this test. If it is supposed to be a bool, then it has a strange type and a confusing name.

**If the type is correct, the intention is probably to pass it to the code under test, but this does not happen.**

https://github.com/borgbackup/borg/blob/e8ff51b0f90b994b3931722a4aaca2c57130126d/src/borg/testsuite/archiver.py#L1848-L1887

<!--
#### Can you reproduce the problem? If so, describe how. If not, describe troubleshooting steps you took before opening the issue.

#### Include any warning/errors/backtraces from the system logs


If this complaint relates to borg performance, please include CRUD benchmark
results and any steps you took to troubleshoot.
How to run benchmark: http://borgbackup.readthedocs.io/en/stable/usage/benchmark.html

*IMPORTANT* - Please mark logs and text output from terminal commands 
or else Github will not display them correctly. 
An example is provided below.

Example:
```
this is an example how log text should be marked (wrap it with ```)
```
-->



Discussion:
It is a string. In Python, strings are truthy if they are not empty.

Resolving patch:
diff --git a/src/borg/testsuite/archiver.py b/src/borg/testsuite/archiver.py
--- a/src/borg/testsuite/archiver.py
+++ b/src/borg/testsuite/archiver.py
@@ -1854,15 +1854,11 @@ def test_unknown_feature_on_mount(self):
 
     @pytest.mark.allow_cache_wipe
     def test_unknown_mandatory_feature_in_cache(self):
-        if self.prefix:
-            path_prefix = 'ssh://__testsuite__'
-        else:
-            path_prefix = ''
-
+        remote_repo = bool(self.prefix)
         print(self.cmd('init', '--encryption=repokey', self.repository_location))
 
         with Repository(self.repository_path, exclusive=True) as repository:
-            if path_prefix:
+            if remote_repo:
                 repository._location = Location(self.repository_location)
             manifest, key = Manifest.load(repository, Manifest.NO_OPERATION_CHECK)
             with Cache(repository, key, manifest) as cache:
@@ -1887,7 +1883,7 @@ def wipe_wrapper(*args):
             assert called
 
         with Repository(self.repository_path, exclusive=True) as repository:
-            if path_prefix:
+            if remote_repo:
                 repository._location = Location(self.repository_location)
             manifest, key = Manifest.load(repository, Manifest.NO_OPERATION_CHECK)
             with Cache(repository, key, manifest) as cache:


Test patch: