mirror of
https://github.com/deadc0de6/dotdrop.git
synced 2026-02-05 01:34:42 +00:00
keep dotpath as a relative path when importing
This commit is contained in:
@@ -60,9 +60,9 @@ def create_dir(path):
|
||||
return path
|
||||
|
||||
|
||||
def load_config(confpath, dotpath, profile):
|
||||
def load_config(confpath, profile):
|
||||
'''Load the config file from path'''
|
||||
conf = Cfg(confpath, dotpath)
|
||||
conf = Cfg(confpath)
|
||||
opts = conf.get_configs()
|
||||
opts['dry'] = False
|
||||
opts['profile'] = profile
|
||||
|
||||
@@ -95,12 +95,12 @@ class TestCompare(unittest.TestCase):
|
||||
backup=self.CONFIG_BACKUP,
|
||||
create=self.CONFIG_CREATE)
|
||||
self.assertTrue(os.path.exists(confpath))
|
||||
conf, opts = load_config(confpath, self.CONFIG_DOTPATH, profile)
|
||||
conf, opts = load_config(confpath, profile)
|
||||
dfiles = [d1, d2, d3, d4, d5]
|
||||
|
||||
# import the files
|
||||
importer(opts, conf, dfiles)
|
||||
conf, opts = load_config(confpath, self.CONFIG_DOTPATH, profile)
|
||||
conf, opts = load_config(confpath, profile)
|
||||
|
||||
# compare the files
|
||||
expected = {d1: True, d2: True, d3: True, d4: True, d5: True}
|
||||
@@ -137,5 +137,6 @@ class TestCompare(unittest.TestCase):
|
||||
def main():
|
||||
unittest.main()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
||||
@@ -33,7 +33,7 @@ class TestConfig(unittest.TestCase):
|
||||
dotpath=self.CONFIG_DOTPATH,
|
||||
backup=self.CONFIG_BACKUP,
|
||||
create=self.CONFIG_CREATE)
|
||||
conf = Cfg(confpath, self.CONFIG_DOTPATH)
|
||||
conf = Cfg(confpath)
|
||||
self.assertTrue(conf is not None)
|
||||
|
||||
opts = conf.get_configs()
|
||||
@@ -49,5 +49,6 @@ class TestConfig(unittest.TestCase):
|
||||
def main():
|
||||
unittest.main()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
||||
@@ -70,7 +70,7 @@ class TestImport(unittest.TestCase):
|
||||
backup=self.CONFIG_BACKUP,
|
||||
create=self.CONFIG_CREATE)
|
||||
self.assertTrue(os.path.exists(confpath))
|
||||
conf, opts = load_config(confpath, self.CONFIG_DOTPATH, profile)
|
||||
conf, opts = load_config(confpath, profile)
|
||||
|
||||
# create some random dotfiles
|
||||
dotfile1, content1 = create_random_file(src)
|
||||
@@ -100,7 +100,7 @@ class TestImport(unittest.TestCase):
|
||||
importer(opts, conf, dfiles)
|
||||
|
||||
# reload the config
|
||||
conf, opts = load_config(confpath, self.CONFIG_DOTPATH, profile)
|
||||
conf, opts = load_config(confpath, profile)
|
||||
|
||||
# test dotfiles in config class
|
||||
self.assertTrue(profile in conf.get_profiles())
|
||||
@@ -133,5 +133,6 @@ class TestImport(unittest.TestCase):
|
||||
def main():
|
||||
unittest.main()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
||||
@@ -82,11 +82,11 @@ exec bspwm
|
||||
profile = get_string(5)
|
||||
confpath = os.path.join(tmp, self.CONFIG_NAME)
|
||||
self.fake_config(confpath, [d1, d2, d3, d4], profile, tmp)
|
||||
conf = Cfg(confpath, tmp)
|
||||
conf = Cfg(confpath)
|
||||
self.assertTrue(conf is not None)
|
||||
|
||||
# install them
|
||||
conf, opts = load_config(confpath, tmp, profile)
|
||||
conf, opts = load_config(confpath, profile)
|
||||
opts['safe'] = False
|
||||
install(opts, conf)
|
||||
|
||||
@@ -108,5 +108,6 @@ exec bspwm
|
||||
def main():
|
||||
unittest.main()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
||||
Reference in New Issue
Block a user