Beispiel #1
0
 def test_single_file(self):
     content = "Hello, world!"
     path = os.path.join(self.local, "file.txt")
     with open(path, "w") as f:
         f.write(content)
     wait_until(os.path.exists, path)
     self.assertTrue(open(path).read(), content)
Beispiel #2
0
 def test_single_file_with_delay(self):
     path = os.path.join(self.local, "file.txt")
     with open(path, "w") as f:
         f.write("Hello, world!")
     wait_until(os.path.exists, os.path.join(self.remote, "test", "file.txt"), sleep=.01)
     time.sleep(6) # should be greater than dir_cache_max_time
     self.assertTrue(os.path.exists(path))
Beispiel #3
0
 def test_single_file(self):
     path = os.path.join(self.local, "file.txt")
     with open(path, "w") as f:
         f.write("Hello, world!")
     wait_until(os.path.exists,
                os.path.join(self.remote, "test", "file.txt"),
                sleep=.01)
     self.assertTrue(os.path.exists(path))
Beispiel #4
0
 def test_multile_files(self):
     for i in range(0, 50):
         filename = "file%d.txt" % i
         path = os.path.join(self.local, filename)
         with open(path, "w") as f:
             f.write("Hello, world! #%d" % i)
         wait_until(os.path.exists, os.path.join(self.remote, "test", filename), sleep=0.01)
         self.assertTrue(os.path.exists(path))
Beispiel #5
0
 def test_single_content(self):
     content = "Hello, world!"
     path = os.path.join(self.local, "file.txt")
     with open(path, "w") as f:
         f.write(content)
     wait_until(os.path.exists, os.path.join(self.remote, "test", "file.txt"), sleep=.01)
     self.assertTrue(os.path.exists(path))
     self.assertEquals(open(path).read(), content)
Beispiel #6
0
 def test_single_file_with_delay(self):
     path = os.path.join(self.local, "file.txt")
     with open(path, "w") as f:
         f.write("Hello, world!")
     wait_until(os.path.exists,
                os.path.join(self.remote, "test", "file.txt"),
                sleep=.01)
     time.sleep(6)  # should be greater than dir_cache_max_time
     self.assertTrue(os.path.exists(path))
Beispiel #7
0
 def test_file_sync_without_listdir(self):
     p1 = os.path.join(self.l1, "file.txt")
     p2 = os.path.join(self.l2, "file.txt")
     with open(p1, "w") as f:
         f.write("Hello, world!")
     wait_until(os.path.exists,
                os.path.join(self.remote, "test", "file.txt"),
                sleep=0.01)
     self.assertTrue(wait_until(os.path.exists, p1, throw_exception=False))
     self.assertTrue(wait_until(os.path.exists, p2, throw_exception=False))
Beispiel #8
0
 def test_multile_files(self):
     for i in range(0, 50):
         filename = "file%d.txt" % i
         path = os.path.join(self.local, filename)
         with open(path, "w") as f:
             f.write("Hello, world! #%d" % i)
         wait_until(os.path.exists,
                    os.path.join(self.remote, "test", filename),
                    sleep=0.01)
         self.assertTrue(os.path.exists(path))
Beispiel #9
0
 def test_single_content(self):
     content = "Hello, world!"
     path = os.path.join(self.local, "file.txt")
     with open(path, "w") as f:
         f.write(content)
     wait_until(os.path.exists,
                os.path.join(self.remote, "test", "file.txt"),
                sleep=.01)
     self.assertTrue(os.path.exists(path))
     self.assertEquals(open(path).read(), content)
Beispiel #10
0
 def test_single_file(self):
     path = os.path.join(self.local, "file.txt")
     with open(path, "w") as f:
         f.write("Hello, world!")
     wait_until(os.path.exists, os.path.join(self.remote, "test", "file.txt"), sleep=.01)
     self.assertTrue(os.path.exists(path))