def test_empty_move(self): oldfilepath = Files.temp_put("hello") movesql("sqlite:///%s" % oldfilepath, "move", temppath()) assert not os.path.exists(oldfilepath) assert os.path.exists(cwd("cuckoo.db")) assert not os.path.islink(cwd("cuckoo.db")) assert open(cwd("cuckoo.db"), "rb").read() == "hello"
def test_empty_move(self): oldfilepath = Files.temp_put("hello") movesql("sqlite:///%s" % oldfilepath, "move", temppath()) assert not os.path.exists(oldfilepath) assert os.path.exists(cwd("cuckoo.db")) assert not os.path.islink(cwd("cuckoo.db")) assert open(cwd("cuckoo.db"), "rb").read() == "hello"
def test_empty_symlink(self): oldfilepath = Files.temp_put("hello") try: movesql("sqlite:///%s" % oldfilepath, "symlink", temppath()) # Following is non-windows. assert os.path.exists(oldfilepath) assert os.path.exists(cwd("cuckoo.db")) assert os.path.islink(cwd("cuckoo.db")) assert open(cwd("cuckoo.db"), "rb").read() == "hello" except RuntimeError as e: assert is_windows() assert "'symlink'" in e.message
def test_empty_symlink(self): oldfilepath = Files.temp_put("hello") try: movesql("sqlite:///%s" % oldfilepath, "symlink", temppath()) # Following is non-windows. assert os.path.exists(oldfilepath) assert os.path.exists(cwd("cuckoo.db")) assert os.path.islink(cwd("cuckoo.db")) assert open(cwd("cuckoo.db"), "rb").read() == "hello" except RuntimeError as e: assert is_windows() assert "'symlink'" in e.message
def test_postgresql(self): movesql("postgresql://*****:*****@localhost/baz", None, None)
def test_mysql(self): movesql("mysql://*****:*****@localh0st/baz", None, None)
def test_postgresql(self): movesql("postgresql://*****:*****@localhost/baz", None, None)
def test_mysql(self): movesql("mysql://*****:*****@localh0st/baz", None, None)