1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-12-26 09:56:13 +01:00
Commit Graph

20 Commits

Author SHA1 Message Date
fe59986e1c Run autopep8 to fix whitespace issues 2022-09-12 13:45:19 +02:00
b511be20ff Always import at the toplevel 2022-09-12 13:45:19 +02:00
feb53212dd Modernize code with pyupgrade
pyupgrade --keep-percent-format --py36-plus `find -name '*.py'`
2022-07-28 19:14:12 +02:00
229913a77f Clean imports up, drop python 2 fallbacks 2022-07-28 13:17:43 +02:00
25a6e04e2b Run tests via calling 'setup.py test' 2022-03-29 14:01:55 +02:00
lethliel
2b47be6b1e switch to difflib.diff_bytes in python3 case.
The files are now opened as rb for diffing. In python2 nothing changes.
In python3 the returned diff is bytes now.

The following changes were made:
  * commandline.py: The returned diff is now bytes
  * get_diff now returs the diff as a bytes-like object
  * run_pager writes with sys.stdout.buffer.write if message
    is not a string
  * for the commit message the returned diff needs to be decoded
    now. Otherwise it will just producce garbage. For the commit
    message the diff on decoded bytes-objects is ok. (nothing harmfull
    can happen here)
  * fixed submit_action_diff
  * fixed request_interactive_review
2019-07-24 13:48:39 +02:00
Adam Spiers
9b1c6f0204 - refactor assertEqualMultiline into common.py for reuse
This will be reused by the tests for the imminent prdiff subcommand.
2013-01-18 22:38:21 +00:00
Marcus Huewe
33f3ab4203 - sigh... make jenkins happy again (finally)
The jenkins build got broken by commit 178120c99e
(python 2.6's re.sub doesn't support a flags argument).
2013-01-18 18:27:50 +01:00
Marcus Huewe
178120c99e - make travis-ci happy again...
It got broken in commit 6a332bc1c6
2013-01-18 18:12:41 +01:00
Marcus Huewe
6a332bc1c6 - tests.test_difffiles: removed "count" argument from re.sub in __canonise_diff
Old python versions don't support "count". This should fix the jenkins build
again.
2013-01-18 17:11:42 +01:00
Marcus Huewe
203a4eeab5 - tests.test_difffiles: added TODO to __canonise_diff. 2013-01-18 16:37:08 +01:00
Adam Spiers
ef0f24c2f6 - avoid false negative failures due to trivial differences in diff hunk headers
When a hunk header refers to a single line in the "from"
  file and/or the "to" file, e.g.

    @@ -37,37 +41,43 @@
    @@ -37,39 +41,41 @@
    @@ -37,37 +41,41 @@

  some systems will avoid repeating the line number:

    @@ -37 +41,43 @@
    @@ -37,39 +41 @@
    @@ -37 +41 @@

  so we need to canonise the output to avoid false negative
  test failures.
2013-01-18 13:44:30 +00:00
Adam Spiers
479f5d5011 - improve output of assertEquals failures on multi-line strings 2013-01-18 13:44:30 +00:00
Marcus Huewe
062bb35c95 - removed unused imports 2010-12-19 20:32:06 +01:00
Marcus Huewe
044c678455 - fixed test_difffiles testsuite for python2.7
python2.7's difflib slightly changed the format
2010-09-08 12:10:09 +02:00
Marcus Huewe
94eb143d8c - small fixes for do_status and get_diff
- get_diff:
  * more helpful error message if a file was added and the local
    file was removed again
  * unify self.filenamelist and self.to_be_added if self.todo is empty
  * extended testcases
- do_status: be able to run "osc st <nonexistentfile>"
2010-09-02 13:47:42 +02:00
Marcus Huewe
b718669685 - raise OscIOError instead of IOError (adjusted testcases) 2010-09-02 10:23:37 +02:00
Marcus Huewe
7802dfa9ad - fixed patch header 2010-08-31 17:30:31 +02:00
Marcus Huewe
9c5c329a04 - get_diff: don't diff binary files 2010-08-31 13:30:37 +02:00
Marcus Huewe
19c63111b6 - added testcases for the new "get_diff" method 2010-08-31 13:30:36 +02:00