Coverage for src/pyenbc/remote/cloud_transfer.py: 50%

14 statements  

« prev     ^ index     » next       coverage.py v6.4.2, created at 2022-07-20 05:47 +0200

1""" 

2@file 

3@brief Common API for many remote drives 

4 

5.. versionadded:: 1.3 

6""" 

7from pyquickhelper.loghelper import noLOG 

8 

9 

10class CloudTransfer: 

11 """ 

12 defines a common API for a remote storage 

13 """ 

14 

15 def __init__(self, user, pwd, fLOG=None): 

16 """ 

17 constructor 

18 

19 @param user user name 

20 @param pwd password 

21 @param fLOG logging function 

22 """ 

23 self._user = user 

24 self._pwd = pwd 

25 self.fLOG = noLOG if fLOG is None else fLOG 

26 

27 def connect(self): 

28 """ 

29 connect 

30 """ 

31 raise NotImplementedError() 

32 

33 def close(self): 

34 """ 

35 close the connection 

36 """ 

37 raise NotImplementedError() 

38 

39 def upload_data(self, remote_path, data): 

40 """ 

41 upload binary data 

42 

43 @param remote_path path on the remote drive 

44 @param data bytes 

45 @return boolean 

46 """ 

47 raise NotImplementedError() 

48 

49 def download_data(self, remote_path): 

50 """ 

51 download binary data 

52 

53 @param remote_path path on the remote drive 

54 @return data (bytes) 

55 """ 

56 raise NotImplementedError()