示例#1
0
 def test_using_standard_config_dir_when_nothing_else_is_specified(
     self,
     monkeypatch,
 ):
     monkeypatch.setattr(os, 'environ', {})
     assert resolve_config_directory() \
         == Path('~/.config/astrality').expanduser()
示例#2
0
 def test_using_standard_config_dir_when_nothing_else_is_specified(
     self,
     monkeypatch,
 ):
     """In the absence of XDG_CONFIG_HOME, the standard location is used."""
     monkeypatch.setattr(os, 'environ', {})
     assert resolve_config_directory() \
         == Path('~/.config/astrality').expanduser()
示例#3
0
 def test_setting_directory_using_xdg_directory_standard(self, monkeypatch):
     monkeypatch.setattr(
         os,
         'environ',
         {
             'XDG_CONFIG_HOME': '/xdg/dir',
         },
     )
     assert resolve_config_directory() == Path('/xdg/dir/astrality')
示例#4
0
 def test_setting_directory_using_xdg_directory_standard(self, monkeypatch):
     """The XDG_CONFIG_HOME environment variable should be respected."""
     monkeypatch.setattr(
         os,
         'environ',
         {
             'XDG_CONFIG_HOME': '/xdg/dir',
         },
     )
     assert resolve_config_directory() == Path('/xdg/dir/astrality')
示例#5
0
 def test_setting_directory_using_application_env_variable(
         self, monkeypatch):
     monkeypatch.setattr(
         os,
         'environ',
         {
             'ASTRALITY_CONFIG_HOME': '/test/dir',
             'XDG_CONFIG_HOME': '/xdg/dir',
         },
     )
     assert resolve_config_directory() == Path('/test/dir')