mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-09-13 14:32:28 +03:00
use common var for 'config.yml', standarize on UTF-8
This makes it easy to track all the places that use config.yml, and hopefully makes things feel cleaner. This also standardizes all places where config.yml is written out to use UTF-8 as the file encoding. This also includes a lot of black code format fixes.
This commit is contained in:
parent
1f96a84f9a
commit
3cc6c09ffc
14 changed files with 189 additions and 173 deletions
|
@ -800,7 +800,7 @@ class Test_ScannerTool(unittest.TestCase):
|
|||
|
||||
def test_refresh_from_config(self):
|
||||
os.chdir(self.testdir)
|
||||
pathlib.Path('config.yml').write_text('refresh_scanner: true')
|
||||
fdroidserver.common.write_config_file('refresh_scanner: true\n')
|
||||
with mock.patch('fdroidserver.scanner.ScannerTool.refresh') as refresh:
|
||||
fdroidserver.scanner.ScannerTool()
|
||||
refresh.assert_called_once()
|
||||
|
@ -809,7 +809,7 @@ class Test_ScannerTool(unittest.TestCase):
|
|||
fdroidserver.common.options = mock.Mock()
|
||||
fdroidserver.common.options.refresh_scanner = True
|
||||
os.chdir(self.testdir)
|
||||
pathlib.Path('config.yml').write_text('refresh_scanner: false')
|
||||
fdroidserver.common.write_config_file('refresh_scanner: false\n')
|
||||
with mock.patch('fdroidserver.scanner.ScannerTool.refresh') as refresh:
|
||||
fdroidserver.scanner.ScannerTool()
|
||||
refresh.assert_called_once()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue