ansible/test/units/plugins
Marius Gedminas 0a7f2c202b Improve --diff output when files lack trailing newlines
The behavior now matches GNU diff.

Fixes #14094.

Example of output before this change:

    TASK [healthchecks.io : hourly healthchecks.io ping] ***************************
    changed: [ranka]
    --- before: /etc/cron.hourly/mg-healthchecks-dot-io
    +++ after: /tmp/tmpOTvXTw
    @@ -1,2 +1,2 @@
     #!/bin/sh
    -curl -sS https://hchk.io/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx > /dev/null+curl -sS https://hchk.io/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx > /dev/null

after this change:

    TASK [healthchecks.io : hourly healthchecks.io ping] ***************************
    changed: [ranka]
    --- before: /etc/cron.hourly/mg-healthchecks-dot-io
    +++ after: /tmp/tmpOTvXTw
    @@ -1,2 +1,2 @@
     #!/bin/sh
    -curl -sS https://hchk.io/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx > /dev/null
    \ No newline at end of file
    +curl -sS https://hchk.io/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx > /dev/null

The added unit tests contain more examples.

This commit also takes care to avoid "no newline at EOF" warnings when
no_log is in effect, and also when modules return dicts rather than
strings.  (It also removes trailing whitespace from using json
serialization when diffing dicts, because I hate trailing whitespace in
Python source files, even if they're test files.)
2017-01-09 11:49:03 -05:00
..
action Removed dict.iteritems() in several other files. 2016-12-14 08:01:45 -08:00
cache Provide slightly better msg on fact cache error (#18759) 2016-12-13 14:34:58 -05:00
callback Improve --diff output when files lack trailing newlines 2017-01-09 11:49:03 -05:00
connection add back reverted change to network_cli (#18761) 2016-12-05 21:42:09 -05:00
filter Add empty-init code-smell script. (#18406) 2016-11-07 15:02:13 -08:00
inventory Add empty-init code-smell script. (#18406) 2016-11-07 15:02:13 -08:00
lookup Lastpass lookup plugin (#16285) 2016-12-22 14:47:33 -08:00
shell Add empty-init code-smell script. (#18406) 2016-11-07 15:02:13 -08:00
strategy Template "original_task" fields in _process_pending_results 2016-12-21 10:09:06 -06:00
vars Add empty-init code-smell script. (#18406) 2016-11-07 15:02:13 -08:00
__init__.py Add empty-init code-smell script. (#18406) 2016-11-07 15:02:13 -08:00
test_plugins.py Fix ziploader for the cornercase of ansible invoking ansible. 2016-04-29 08:47:49 -07:00