예제 #1
0
 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"
예제 #2
0
 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"
예제 #3
0
    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
예제 #4
0
    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
예제 #5
0
 def test_postgresql(self):
     movesql("postgresql://*****:*****@localhost/baz", None, None)
예제 #6
0
 def test_mysql(self):
     movesql("mysql://*****:*****@localh0st/baz", None, None)
예제 #7
0
 def test_postgresql(self):
     movesql("postgresql://*****:*****@localhost/baz", None, None)
예제 #8
0
 def test_mysql(self):
     movesql("mysql://*****:*****@localh0st/baz", None, None)