示例#1
0
 def test_add_to_map(self):
     dm = DotfileMap()
     dm.add("./dotfiles-user/.vim", "README", "2")
     dm.add("./dotfiles-a/.vim", "README", "1")
     self.assertTrue(".vim/README" in dm.files)
     self.assertEqual(len(dm.files), 1)
     self.assertEqual(dm.files[".vim/README"].dirpath, [".vim"])
示例#2
0
 def test_keyname(self):
     dirpath = [".vim", "bundle"]
     filename = "README"
     keyname = DotfileMap.keyname(dirpath, filename)
     self.assertEqual(keyname, ".vim/bundle/README")
示例#3
0
 def test_extract_module_name(self):
     path = "./dotfiles-z/vim/bundle/ctrlp"
     module, dirpath = DotfileMap._parse_dirpath(path)
     self.assertEqual(module, "dotfiles-z")
     self.assertEqual(dirpath, ["vim", "bundle", "ctrlp"])