Exemplo n.º 1
0
 def test_remotefile3(self):
     """store file"""
     f = RORemoteFile('/source/project/package/fname2')
     sio = StringIO()
     f.write_to(sio, size=12)
     self.assertEqual(sio.getvalue(), 'yet another\n')
     sio = StringIO()
     f.write_to(sio)
     self.assertEqual(sio.getvalue(), 'simple\nfile\n')
Exemplo n.º 2
0
 def test_remotefile3(self):
     """store file"""
     f = RORemoteFile('/source/project/package/fname2')
     sio = StringIO()
     f.write_to(sio, size=12)
     self.assertEqual(sio.getvalue(), 'yet another\n')
     sio = StringIO()
     f.write_to(sio)
     self.assertEqual(sio.getvalue(), 'simple\nfile\n')
Exemplo n.º 3
0
 def test_remotefile5(self):
     """store file"""
     f = RORemoteFile('/source/project/package/fname2', mtime=1311512569)
     path = self.fixture_file('write_me')
     f.write_to(path)
     self.assertEqualFile('yet another\nsimple\nfile\n', 'remotefile2')
     st = os.stat(path)
     self.assertEqual(st.st_mtime, 1311512569)
     # default mode is 0644
     self.assertEqual(stat.S_IMODE(st.st_mode), 420)
Exemplo n.º 4
0
 def test_remotefile5(self):
     """store file"""
     f = RORemoteFile('/source/project/package/fname2', mtime=1311512569)
     path = self.fixture_file('write_me')
     f.write_to(path)
     self.assertEqualFile('yet another\nsimple\nfile\n', 'remotefile2')
     st = os.stat(path)
     self.assertEqual(st.st_mtime, 1311512569)
     # default mode is 0644
     self.assertEqual(stat.S_IMODE(st.st_mode), 420)