Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#90 fix CLI call with --config-file option #91

Merged
merged 1 commit into from
Oct 30, 2020
Merged

#90 fix CLI call with --config-file option #91

merged 1 commit into from
Oct 30, 2020

Conversation

tbcvl
Copy link
Contributor

@tbcvl tbcvl commented Oct 29, 2020

Cf. #90

New test without the fix:

$ pytest tests/acceptance/test_cli.py::test_configuration_file_from_cli
...
/home/tbcvl/Documents/dev/septentrion/septentrion/cli.py:37: in load_config
    ctx.default_map = configuration.load_configuration_files(value)
/home/tbcvl/Documents/dev/septentrion/septentrion/configuration.py:195: in load_configuration_files
    return parse_configuration_file(file_contents)
/home/tbcvl/Documents/dev/septentrion/septentrion/configuration.py:84: in parse_configuration_file
    parser.read_string(content)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <configparser.ConfigParser object at 0x7f14b5fa3438>
string = b'[septentrion]\nschema_version=20.10\ntarget_version=20.11\nschema_template=schema_{}.sql\nbefore_schema_file=\n    roles.sql\nafter_schema_file=\n    after_schemas.sql\nfixtures_template=fixtures_{}.sql\n', source = '<string>'

    def read_string(self, string, source='<string>'):
        """Read configuration from a given string."""
>       sfile = io.StringIO(string)
E       TypeError: initial_value must be str or None, not bytes

/usr/local/lib/python3.6/configparser.py:722: TypeError

I'm not familiar with septentrion architecture, feel free to tell me if there's a better place for the fix.

Successful PR Checklist:

  • Tests
  • bugfix, no documentation needed

@codecov
Copy link

codecov bot commented Oct 29, 2020

Codecov Report

Merging #91 into master will increase coverage by 0.31%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #91      +/-   ##
==========================================
+ Coverage   78.66%   78.97%   +0.31%     
==========================================
  Files          15       15              
  Lines         642      642              
  Branches       81       81              
==========================================
+ Hits          505      507       +2     
+ Misses        127      126       -1     
+ Partials       10        9       -1     
Flag Coverage Δ
#matrix.coverage-flag 78.97% <ø> (+0.31%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
septentrion/cli.py 0.00% <ø> (ø)
septentrion/configuration.py 86.45% <0.00%> (+2.08%) ⬆️

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 361864c...e0f7f9e. Read the comment docs.

@tbcvl
Copy link
Contributor Author

tbcvl commented Oct 29, 2020

unit test added and better place for fix.

@ewjoachim
Copy link
Contributor

ewjoachim commented Oct 30, 2020

I think your commit has no commit message... ?

Screenshot from 2020-10-30 10-21-52

The rest seems A-OK ! You're welcome to merge when the message is fixed.

@tbcvl tbcvl merged commit a8c9fac into master Oct 30, 2020
@tbcvl tbcvl deleted the convert_bytes branch October 30, 2020 09:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants