mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-09-13 22:42:29 +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
|
@ -28,12 +28,13 @@ class InitTest(unittest.TestCase):
|
|||
self._td.cleanup()
|
||||
|
||||
def test_disable_in_config(self):
|
||||
configfile = pathlib.Path('config.yml')
|
||||
configfile.write_text('keystore: NONE\nkeypass: mysupersecrets\n')
|
||||
test = 'mysupersecrets'
|
||||
configfile = pathlib.Path(fdroidserver.common.CONFIG_FILE)
|
||||
configfile.write_text(f'keystore: NONE\nkeypass: {test}\n', encoding='utf-8')
|
||||
configfile.chmod(0o600)
|
||||
config = fdroidserver.common.read_config()
|
||||
self.assertEqual('NONE', config['keystore'])
|
||||
self.assertEqual('mysupersecrets', config['keypass'])
|
||||
self.assertEqual(test, config['keypass'])
|
||||
fdroidserver.init.disable_in_config('keypass', 'comment')
|
||||
self.assertIn('#keypass:', configfile.read_text())
|
||||
fdroidserver.common.config = None
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue