Ejemplo n.º 1
0
    def testOnlyPyInUserFolder(self):
        user_config = Path(self.user_config_dir, 'config.py')

        user_config.touch()

        config_path = test.find_config_path()
        self.assertEqual(str(config_path), str(user_config))
Ejemplo n.º 2
0
    def testOnlyPyInAppFolder(self):
        app_config = Path(self.app_config_dir, 'config.py')

        app_config.touch()

        config_path = test.find_config_path()
        self.assertEqual(str(config_path), str(app_config))
Ejemplo n.º 3
0
    def testReturnTypeIsPath(self):
        # Setup
        try:
            config_path = test.find_config_path()
        except Exception:
            self.fail('Failed to find config')

        self.assertIsInstance(
            config_path, Path,
            'Config path return value is not a pathlib Path')
Ejemplo n.º 4
0
    def testNoConfigInAnyFolder(self):
        """
		This should automatically generate a JSON config in app config dir
		"""

        config_path_json = self.app_config_dir.joinpath('config.json')
        if config_path_json.exists():
            config_path_json.unlink()
        config_path = test.find_config_path()
        self.assertEqual(str(config_path), str(config_path_json))