pegleg/src/bin/pegleg/tests/unit/engine
Felipe Monteiro 54e30687d4 Fix --save-location bugs for collect command
This addresses 2 concerns:

1) When -s or --save-location is omitted for pegleg
   site collect command, the following error is raised:

     TypeError: '_io.TextIOWrapper' object is not subscriptable

   That is because the default kwarg for the associated option
   is sys.stdout [0] which returns an object not a path, causing
   the Click library itself to blow up. Note that this is dropped
   in master [1], which isn't correct, as there is a desire to
   use stdout as the default location for collection output.

   Thus, new logic is added to output the collected document data
   to stdout.

2) When a directory doesn't exist and -s is provided (as an example
   pegleg site -p /path/to/primary/dir collect <site_name> -s <non_existent_dir>)
   it is better to just create it via os.makedirs() than to error out
   with an exception [2].

[0] d9692126ed (diff-bd81bbb896486546c9e59d018a83d05d)
[1] f25b5b6593/src/bin/pegleg/pegleg/cli.py (L72)
[2] 843d1a5010/src/bin/pegleg/pegleg/engine/site.py (L36)

Change-Id: Ie1da73efa437cbdfbe6d2b7ab616a1467eb57358
2018-08-01 16:14:12 +01:00
..
util git: Raise exception on ref checkout from dirty repo 2018-07-24 18:58:09 +00:00
__init__.py [fix] Render documents by each site to avoid false positives 2018-05-16 14:34:16 +00:00
test_collect.py Fix --save-location bugs for collect command 2018-08-01 16:14:12 +01:00
test_lint.py Fix missing error handling during pegleg render 2018-06-14 19:01:48 +05:30
test_selectable_linting.py [fix] Render documents by each site to avoid false positives 2018-05-16 14:34:16 +00:00
test_util_files.py [fix] Render documents by each site to avoid false positives 2018-05-16 14:34:16 +00:00