StackStorm / orquestaconvert

Converts Mistral workflows into Orchestra workflows
Apache License 2.0
13 stars 7 forks source link

Support publishing booleans and nulls #9

Closed blag closed 6 years ago

blag commented 6 years ago

This PR adds support for publishing simple booleans and nulls.

Before, this:

    ...
    publish:
      - foo: true
      - bar: false
      - baz: null

would get converted to:

    ...
    publish:
      - foo:
      - bar:
      - baz:

This PR adds support for publishing booleans, and adds internal support for null/None publish values. Regarding converting nulls/Nones, it doesn't really matter, since Ruamel only implicitly serializes null values, eg:

    ...
    publish:
      - baz: null

will still be serialized to:

    ...
    publish:
      - baz:  # implicit null here

There are ways around that (see Bitbucket#169), but it seemed slightly more involved and outside the scope of this PR.

The PR also emits an error if it cannot recognize a type to convert, like an object object for instance.

I also use the unittest2 library, since that is backwards compatible with unittest, it is already required by the tests, and it provides assertWarnsRegex.

codecov-io commented 6 years ago

Codecov Report

Merging #9 into master will increase coverage by <.01%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master      #9      +/-   ##
=========================================
+ Coverage    99.7%   99.7%   +<.01%     
=========================================
  Files           9       9              
  Lines         334     343       +9     
=========================================
+ Hits          333     342       +9     
  Misses          1       1
Impacted Files Coverage Δ
orquestaconvert/expressions/__init__.py 100% <100%> (ø) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 4376902...a35dd92. Read the comment docs.