Advertisement
Guest User

Untitled

a guest
Dec 29th, 2018
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.65 KB | None | 0 0
  1. ============================================================================================== test session starts ===============================================================================================
  2. platform linux -- Python 3.7.1, pytest-4.0.2, py-1.7.0, pluggy-0.8.0
  3. rootdir: /mnt/home/evan/Sources/aur/borgmatic/src/borgmatic, inifile:
  4. collected 219 items
  5.  
  6. tests/end-to-end/test_borgmatic.py F [ 0%]
  7. tests/integration/commands/test_borgmatic.py ........................F [ 11%]
  8. tests/integration/commands/test_convert_config.py .... [ 13%]
  9. tests/integration/commands/test_generate_config.py .. [ 14%]
  10. tests/integration/config/test_generate.py ............ [ 20%]
  11. tests/integration/config/test_legacy.py . [ 20%]
  12. tests/integration/config/test_validate.py ........ [ 24%]
  13. tests/unit/test_verbosity.py .. [ 25%]
  14. tests/unit/borg/test_check.py .......................... [ 36%]
  15. tests/unit/borg/test_create.py ............................................. [ 57%]
  16. tests/unit/borg/test_environment.py .... [ 59%]
  17. tests/unit/borg/test_extract.py ....... [ 62%]
  18. tests/unit/borg/test_hook.py ... [ 63%]
  19. tests/unit/borg/test_info.py ....... [ 67%]
  20. tests/unit/borg/test_init.py ........ [ 70%]
  21. tests/unit/borg/test_list.py ....... [ 73%]
  22. tests/unit/borg/test_prune.py .......... [ 78%]
  23. tests/unit/commands/test_borgmatic.py .... [ 80%]
  24. tests/unit/config/test_checks.py ... [ 81%]
  25. tests/unit/config/test_collect.py ......... [ 85%]
  26. tests/unit/config/test_convert.py ......... [ 89%]
  27. tests/unit/config/test_generate.py . [ 90%]
  28. tests/unit/config/test_legacy.py ............. [ 96%]
  29. tests/unit/config/test_validate.py ........ [100%]
  30.  
  31. ==================================================================================================== FAILURES ====================================================================================================
  32. _____________________________________________________________________________________________ test_borgmatic_command _____________________________________________________________________________________________
  33.  
  34. def test_borgmatic_command():
  35. # Create a Borg repository.
  36. temporary_directory = tempfile.mkdtemp()
  37. repository_path = os.path.join(temporary_directory, 'test.borg')
  38.  
  39. try:
  40. config_path = os.path.join(temporary_directory, 'test.yaml')
  41. generate_configuration(config_path, repository_path)
  42.  
  43. subprocess.check_call(
  44. > 'borgmatic -v 2 --config {} --init --encryption repokey'.format(config_path).split(' ')
  45. )
  46.  
  47. tests/end-to-end/test_borgmatic.py:42:
  48. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  49.  
  50. popenargs = (['borgmatic', '-v', '2', '--config', '/tmp/tmpqrru9c3w/test.yaml', '--init', ...],), kwargs = {}, retcode = 2
  51. cmd = ['borgmatic', '-v', '2', '--config', '/tmp/tmpqrru9c3w/test.yaml', '--init', ...]
  52.  
  53. def check_call(*popenargs, **kwargs):
  54. """Run command with arguments. Wait for command to complete. If
  55. the exit code was zero then return, otherwise raise
  56. CalledProcessError. The CalledProcessError object will have the
  57. return code in the returncode attribute.
  58.  
  59. The arguments are the same as for the call function. Example:
  60.  
  61. check_call(["ls", "-l"])
  62. """
  63. retcode = call(*popenargs, **kwargs)
  64. if retcode:
  65. cmd = kwargs.get("args")
  66. if cmd is None:
  67. cmd = popenargs[0]
  68. > raise CalledProcessError(retcode, cmd)
  69. E subprocess.CalledProcessError: Command '['borgmatic', '-v', '2', '--config', '/tmp/tmpqrru9c3w/test.yaml', '--init', '--encryption', 'repokey']' returned non-zero exit status 2.
  70.  
  71. /usr/lib/python3.7/subprocess.py:341: CalledProcessError
  72. ---------------------------------------------------------------------------------------------- Captured stdout call ----------------------------------------------------------------------------------------------
  73. Generated a sample configuration file at /tmp/tmpqrru9c3w/test.yaml.
  74.  
  75. Please edit the file to suit your needs. The values are just representative.
  76. All fields are optional except where indicated.
  77. ---------------------------------------------------------------------------------------------- Captured stderr call ----------------------------------------------------------------------------------------------
  78. usage: borgmatic [-h] [-c CONFIG_PATHS [CONFIG_PATHS ...]]
  79. [--excludes EXCLUDES_FILENAME] [-p] [-C] [-k] [-l] [-i]
  80. [--json] [-n] [-v {0,1,2}]
  81. borgmatic: error: unrecognized arguments: --init --encryption repokey
  82. __________________________________________________________________________________ test_borgmatic_version_matches_news_version ___________________________________________________________________________________
  83.  
  84. def test_borgmatic_version_matches_news_version():
  85. > borgmatic_version = subprocess.check_output(('borgmatic', '--version')).decode('ascii')
  86.  
  87. tests/integration/commands/test_borgmatic.py:177:
  88. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  89. /usr/lib/python3.7/subprocess.py:389: in check_output
  90. **kwargs).stdout
  91. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  92.  
  93. input = None, capture_output = False, timeout = None, check = True, popenargs = (('borgmatic', '--version'),), kwargs = {'stdout': -1}, process = <subprocess.Popen object at 0x7f0891d4d5c0>, stdout = b''
  94. stderr = None, retcode = 2
  95.  
  96. def run(*popenargs,
  97. input=None, capture_output=False, timeout=None, check=False, **kwargs):
  98. """Run command with arguments and return a CompletedProcess instance.
  99.  
  100. The returned instance will have attributes args, returncode, stdout and
  101. stderr. By default, stdout and stderr are not captured, and those attributes
  102. will be None. Pass stdout=PIPE and/or stderr=PIPE in order to capture them.
  103.  
  104. If check is True and the exit code was non-zero, it raises a
  105. CalledProcessError. The CalledProcessError object will have the return code
  106. in the returncode attribute, and output & stderr attributes if those streams
  107. were captured.
  108.  
  109. If timeout is given, and the process takes too long, a TimeoutExpired
  110. exception will be raised.
  111.  
  112. There is an optional argument "input", allowing you to
  113. pass bytes or a string to the subprocess's stdin. If you use this argument
  114. you may not also use the Popen constructor's "stdin" argument, as
  115. it will be used internally.
  116.  
  117. By default, all communication is in bytes, and therefore any "input" should
  118. be bytes, and the stdout and stderr will be bytes. If in text mode, any
  119. "input" should be a string, and stdout and stderr will be strings decoded
  120. according to locale encoding, or by "encoding" if set. Text mode is
  121. triggered by setting any of text, encoding, errors or universal_newlines.
  122.  
  123. The other arguments are the same as for the Popen constructor.
  124. """
  125. if input is not None:
  126. if 'stdin' in kwargs:
  127. raise ValueError('stdin and input arguments may not both be used.')
  128. kwargs['stdin'] = PIPE
  129.  
  130. if capture_output:
  131. if ('stdout' in kwargs) or ('stderr' in kwargs):
  132. raise ValueError('stdout and stderr arguments may not be used '
  133. 'with capture_output.')
  134. kwargs['stdout'] = PIPE
  135. kwargs['stderr'] = PIPE
  136.  
  137. with Popen(*popenargs, **kwargs) as process:
  138. try:
  139. stdout, stderr = process.communicate(input, timeout=timeout)
  140. except TimeoutExpired:
  141. process.kill()
  142. stdout, stderr = process.communicate()
  143. raise TimeoutExpired(process.args, timeout, output=stdout,
  144. stderr=stderr)
  145. except: # Including KeyboardInterrupt, communicate handled that.
  146. process.kill()
  147. # We don't call process.wait() as .__exit__ does that for us.
  148. raise
  149. retcode = process.poll()
  150. if check and retcode:
  151. raise CalledProcessError(retcode, process.args,
  152. > output=stdout, stderr=stderr)
  153. E subprocess.CalledProcessError: Command '('borgmatic', '--version')' returned non-zero exit status 2.
  154.  
  155. /usr/lib/python3.7/subprocess.py:481: CalledProcessError
  156. ---------------------------------------------------------------------------------------------- Captured stderr call ----------------------------------------------------------------------------------------------
  157. usage: borgmatic [-h] [-c CONFIG_PATHS [CONFIG_PATHS ...]]
  158. [--excludes EXCLUDES_FILENAME] [-p] [-C] [-k] [-l] [-i]
  159. [--json] [-n] [-v {0,1,2}]
  160. borgmatic: error: unrecognized arguments: --version
  161. ====================================================================================== 2 failed, 217 passed in 1.48 seconds ======================================================================================
  162. ==> ERROR: A failure occurred in check().
  163. Aborting...
  164. 2018-12-29 15:57:18,179 - wrappers - makepkg - ERROR - makepkg query ['makepkg', '-cf', '--noconfirm'] failed in directory /home/evan/Sources/aur/borgmatic
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement