def test_create_shares_link_existing_source_with_lnk_extension(self): """Add the lnk extension to the end of the file like windows needs.""" base = self.mktemp("test_create_shares_link_makes_the_link") source_path = os.path.join(base, "source") dest_path = os.path.join(base, "dest.lnk") os_helper.make_dir(source_path) self.assertTrue(create_shares_link(source_path, dest_path)) self.assertFalse(create_shares_link(source_path, dest_path))
def test_create_shares_link_existing(self): """create_shares_link on an existing path does nothing.""" base = self.mktemp("test_create_shares_link_makes_the_link") source_path = os.path.join(base, "source") dest_path = os.path.join(base, "dest") os_helper.make_dir(source_path) self.assertTrue(create_shares_link(source_path, dest_path)) self.assertFalse(create_shares_link(source_path, dest_path))
def test_create_shares_link_exists(self): """create_shares_link is noop when there's something with that name.""" base = self.mktemp("test_create_shares_link_exists") source_path = os.path.join(base, "source") dest_path = os.path.join(base, "dest") os_helper.make_dir(dest_path) self.assertFalse(create_shares_link(source_path, dest_path))
def test_create_shares_link_makes_the_link(self): """create_shares_link makes the link as expected.""" base = self.mktemp("test_create_shares_link_makes_the_link") source_path = os.path.join(base, "source") dest_path = os.path.join(base, "dest") os_helper.make_dir(source_path) self.assertTrue(create_shares_link(source_path, dest_path)) self.assertTrue(vm_helper.is_link(dest_path))