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