Exemplo n.º 1
0
 def test_site_data_dir_creates_file(self, tmpdir, mocker, create, faker):
     """Make sure that path creation depends on ``create`` attribute."""
     path = os.path.join(tmpdir.strpath, '{}/'.format(faker.word()))
     mocker.patch('hamster_lib.helpers.config_helpers.appdirs.site_data_dir', return_value=path)
     appdir = HamsterAppDirs('hamster-lib')
     appdir.create = create
     assert os.path.exists(appdir.site_data_dir) is create
Exemplo n.º 2
0
 def test_site_data_dir_creates_file(self, tmpdir, mocker, create, faker):
     """Make sure that path creation depends on ``create`` attribute."""
     path = os.path.join(tmpdir.strpath, '{}/'.format(faker.word()))
     mocker.patch('hamster_lib.helpers.config_helpers.appdirs.site_data_dir', return_value=path)
     appdir = HamsterAppDirs('hamster-lib')
     appdir.create = create
     assert os.path.exists(appdir.site_data_dir) is create
Exemplo n.º 3
0
 def test_user_cache_dir_returns_directoy(self, tmpdir, mocker):
     """Make sure method returns directory."""
     path = tmpdir.strpath
     mocker.patch('hamster_lib.helpers.config_helpers.appdirs.user_cache_dir',
                  return_value=path)
     appdir = HamsterAppDirs('hamster-lib')
     assert appdir.user_cache_dir == path
Exemplo n.º 4
0
def appdirs(request):
    """Return HamsterAppDirs instance."""
    return HamsterAppDirs('hamster-gtk')