コード例 #1
0
    def _setUpSettings():
        # Load keys and passwords for encryption and signing
        for key_name, dev_location in settings._KEYS.items():  # pylint: disable=protected-access
            path = os.getenv(key_name, dev_location)
            vars(settings)[key_name] = settings.read_file(
                path)  # assigns attribute to this module

        for password_name, dev_default in settings._PASSWORDS.items():  # pylint: disable=protected-access
            password = os.getenv(password_name, dev_default)
            vars(settings)[
                password_name] = password  # assigns attribute to this module
コード例 #2
0
 def test_none_filename_does_not_attempt_to_load_file(self):
     self.assertEqual(None, settings.read_file(None))
コード例 #3
0
 def test_missing_get_application_version_from_file(self):
     self.assertEqual(None,
                      settings.read_file('.missing-application-version'))
コード例 #4
0
 def test_get_application_version_from_file(self):
     self.assertIsNotNone(settings.read_file('.application-version'))