Example #1
0
 def test_download(self):
   self.client.upload('foo', self.dpath)
   with temppath() as tpath:
     main(
       ['download', 'foo', tpath, '--silent', '--threads', '1'],
       self.client
     )
     self._dircmp(tpath)
Example #2
0
 def test_download(self):
   self.client.upload('foo', self.dpath)
   with temppath() as tpath:
     main(
       ['download', 'foo', tpath, '--silent', '--threads', '1'],
       self.client
     )
     self._dircmp(tpath)
Example #3
0
 def test_upload(self):
   main(
     ['upload', self.dpath, 'bar', '--silent', '--threads', '1'],
     self.client
   )
   with temppath() as tpath:
     self.client.download('bar', tpath)
     self._dircmp(tpath)
Example #4
0
 def test_upload(self):
   main(
     ['upload', self.dpath, 'bar', '--silent', '--threads', '1'],
     self.client
   )
   with temppath() as tpath:
     self.client.download('bar', tpath)
     self._dircmp(tpath)
Example #5
0
 def test_download_overwrite(self):
     self.client.upload('foo', self.dpath)
     with temppath() as tpath:
         with open(tpath, 'w'):
             pass
         main(['download', 'foo', tpath, '--silent', '--threads', '1'],
              self.client)
         self._dircmp(tpath)
Example #6
0
 def test_upload_force(self):
     self.client.write('bar', 'hey')
     main([
         'upload', self.dpath, 'bar', '--silent', '--threads', '1',
         '--force'
     ], self.client)
     with temppath() as tpath:
         self.client.download('bar', tpath)
         self._dircmp(tpath)
Example #7
0
 def test_upload_force(self):
   self.client.write('bar', 'hey')
   main(
     ['upload', self.dpath, 'bar', '--silent', '--threads', '1', '--force'],
     self.client
   )
   with temppath() as tpath:
     self.client.download('bar', tpath)
     self._dircmp(tpath)
Example #8
0
 def test_download_overwrite(self):
   self.client.upload('foo', self.dpath)
   with temppath() as tpath:
     with open(tpath, 'w'):
       pass
     main(
       ['download', 'foo', tpath, '--silent', '--threads', '1'],
       self.client
     )
     self._dircmp(tpath)
Example #9
0
 def test_download_force(self):
     self.client.write('foo', 'hey')
     with temppath() as tpath:
         with open(tpath, 'w'):
             pass
         main([
             'download', 'foo', tpath, '--silent', '--force', '--threads',
             '1'
         ], self.client)
         with open(tpath) as reader:
             eq_(reader.read(), 'hey')
Example #10
0
 def test_upload_append(self):
   with temppath() as tpath:
     with open(tpath, 'w') as writer:
       writer.write('hey')
     main(['upload', tpath, 'bar', '--silent', '--threads', '1'], self.client)
     main(
       ['upload', tpath, 'bar', '--silent', '--threads', '1', '--append'],
       self.client
     )
   with self.client.read('bar') as reader:
     eq_(reader.read(), b'heyhey')
Example #11
0
 def test_download_force(self):
   self.client.write('foo', 'hey')
   with temppath() as tpath:
     with open(tpath, 'w'):
       pass
     main(
       ['download', 'foo', tpath, '--silent', '--force', '--threads', '1'],
       self.client
     )
     with open(tpath) as reader:
       eq_(reader.read(), 'hey')
Example #12
0
 def test_upload_append(self):
   with temppath() as tpath:
     with open(tpath, 'w') as writer:
       writer.write('hey')
     main(['upload', tpath, 'bar', '--silent', '--threads', '1'], self.client)
     main(
       ['upload', tpath, 'bar', '--silent', '--threads', '1', '--append'],
       self.client
     )
   with self.client.read('bar') as reader:
     eq_(reader.read(), b'heyhey')
Example #13
0
 def test_download_stream(self):
     self.client.write('foo', 'hello')
     with temppath() as tpath:
         stdout = sys.stdout
         try:
             with open(tpath, 'wb') as writer:
                 sys.stdout = writer
                 main(
                     ['download', 'foo', '-', '--silent', '--threads', '1'],
                     self.client)
         finally:
             sys.stdout = stdout
         with open(tpath) as reader:
             eq_(reader.read(), 'hello')
Example #14
0
 def test_download_stream(self):
   self.client.write('foo', 'hello')
   with temppath() as tpath:
     stdout = sys.stdout
     try:
       with open(tpath, 'wb') as writer:
         sys.stdout = writer
         main(
           ['download', 'foo', '-', '--silent', '--threads', '1'],
           self.client
         )
     finally:
       sys.stdout = stdout
     with open(tpath) as reader:
       eq_(reader.read(), 'hello')
Example #15
0
 def test_download_stream_multiple_files(self):
   self.client.upload('foo', self.dpath)
   main(
     ['download', 'foo', '-', '--silent', '--threads', '1'],
     self.client
   )
Example #16
0
 def test_upload_append_folder(self):
   with temppath() as tpath:
     main(['upload', self.dpath, '--silent', '--append'], self.client)
Example #17
0
 def test_download_stream_multiple_files(self):
     self.client.upload('foo', self.dpath)
     main(['download', 'foo', '-', '--silent', '--threads', '1'],
          self.client)
Example #18
0
 def test_upload_overwrite(self):
     self.client.write('bar', 'hey')
     main(['upload', self.dpath, 'bar', '--silent', '--threads', '1'],
          self.client)
Example #19
0
 def test_upload_overwrite(self):
   self.client.write('bar', 'hey')
   main(
     ['upload', self.dpath, 'bar', '--silent', '--threads', '1'],
     self.client
   )
Example #20
0
 def test_upload_append_folder(self):
     with temppath() as tpath:
         main(['upload', self.dpath, '--silent', '--append'], self.client)