summaryrefslogtreecommitdiffstats
path: root/tests/test_main.py
AgeCommit message (Collapse)Author
2021-02-22skip initial comment in pg_session file (#1245)Georgy Frolov
* skip initial comment in pg_session file * add test
2021-02-12Modernize code to Python 3.6+ (#1229)Miroslav Šedivý
1. `class A(object)` can be written as `class A:` 2. replace `dict([…])` and `set([…])` with `{…}` 3. use f-strings or compact `.format` 4. use `yield from` instead of `yield` in a `for` loop 5. import `mock` from `unittest` 6. expect `OSError` instead of `IOError` or `select` error 7. use Python3 defaults for file reading or `super()` 8. remove redundant parenthesis (keep those in tuples though) 9. shorten set intersection instead of creating lists 10. backslashes in strings do not have to be escaped if prepended with `r`
2020-04-17Add pg_service.conf handling (#1155)g.denis
* add parse_service_info * added tests * changelog + AUTHORS * py35
2020-03-14removed py2-related stuffGeorgy Frolov
2019-05-25black all the things. (#1049)Irina Truong
* added black to develop guide * no need for pep8radius. * changelog. * Add pre-commit checkbox. * Add pre-commit to dev reqs. * Add pyproject.toml for black. * Pre-commit config. * Add black to travis and dev reqs. * Install and run black in travis. * Remove black from dev reqs. * Lower black target version. * Re-format with black.
2019-04-27Allow application_name to be overridden (#1044)raylu
* Allow application_name to be overridden * Fixed broken link. * Default password value is empty str? * Make pep8 happier.
2019-01-03Support multihost connection string (#978)Mikhail Elovskikh
* Switch to psycopg2 parse_dsn instead of urlparse * Added wronglink to contributors and updated changelog * Fix test codestyle * Support for PGPORT customization in tests * Support for PGPORT customization in tests * Refactored PGExecute init and moved short_host generation to object property * Fix test util codestyle * Fix local tests run * Store PGExecute initial params in _conn_params and added PGExecute.copy method * Fix codestyle * Added docstring to PGExecute.copy() method
2018-09-28Cherry-picked prompt-toolkit 2.0 changes. (#930)Irina Truong
* Cherry-picked prompt-toolkit 2.0 changes. * Increase help timeout. * Missed one. * Fixes editor command. * Expect exact to fix named query error. * Unicode is non-optional with ptk 2.0. * Unicode literals all the things (almost). * PEP8. * Change how we swap completers. * By default, bottom toolbar styles are reversed. We don't want that. * Adapt styles to 2.0. * The future is now. Switch to ptk 2.0 style names. * PEP8. * Flag for enable_open_in_editor. * add class:prompt to prompt * Removed workaround for #668. Some renaming. * use pgcli.completer instead of app.current_buffer.completer * enable_system_prompt=True like old prompt toolkit * keep search_ignore_case enabled (was ignore_case) * fix closing parenthese * keep marking class:continuation token for continuation * capture KeyboardInterrupt manually AbortAction has been removed in Prompt_toolkit 2.0 * replace C-J with enter, add more comments * reversed ([...]) to [(...)] (oops) * pep8 fixes * Does Vi mode have to be applied to session every time? * (workaround) also enable vi_mode after edit command * Fixed test errors after rebasing on master.
2018-09-23Merge pull request #871 from maxrothman/masterIrina Truong
Respect \pset pager on expected behavior
2018-09-23Respect \pset pager on expected behaviorMax Rothman
"\pset pager" has three possible values: "always", "on", and "off". pgcli previously treated all non-"off" values as "always". This change implements the expected behavior, which is to use the pager when the output is larger than the terminal height (See \pset pager in https://www.postgresql.org/docs/9.2/static/app-psql.html). Pgcli adds to this by also using the pager when the output is wider than the terminal width. Fixes #813
2018-09-22Revert abs imports in tests.Irina Truong
2018-09-22Attempt to fix failing tests. Add some debug info. Make imports py3-compatible.Irina Truong
2018-04-05Mark tests requiring a running database server as dbtestDick Marinus
2017-11-30Fixed tests.Irina Truong
2017-11-30Fixed expanded array test.Irina Truong
2017-08-18Preliminary work for a future change in outputting results that uses less memoryDick Marinus
2017-08-07 Import unicode_literals in test_main.pyJoakim Koljonen
2017-08-06Reformat code for readability and linter happinessJoakim Koljonen
2017-08-06Improve formatting of array outputJoakim Koljonen
Before this change, e.g. `SELECT '{1}'::numeric` would output `[Decimal(1)]`. Now it instead outputs `{1}`.
2017-06-26Move format_output out of Pgcli class.Thomas Roten
2017-06-23PEP8 fixes.Thomas Roten
2017-06-19Merge branch 'master' of github.com:dbcli/pgcli into ↵Thomas Roten
feature/cli_helpers_output_format * 'master' of github.com:dbcli/pgcli: Use standard NullHandler Golf pep8radius Fix PEP8 empty line errors
2017-06-14Fix PEP8 empty line errorsÉtienne BERSAC
2017-06-11Initial work on using CLI Helpers.Thomas Roten
2017-05-25Make it possible to use SSL with pgcliAlexander Schmolck
This adds support for additional url query params which make stuff like ``` pgcli "postgres://user:pass@host.invalid/db?\ sslmode=verify-full&sslcert=my.pem&sslkey=my-key.pem&sslrootcert=ca.pem" ``` work. More generally it allows one to pass through various extra connection options.
2017-03-16Make format_output take a settings objectJoakim Koljonen
2016-09-27master: decimal and float format in config fileFoxygrandpa
2016-06-29Repair exception thrown on urls with portsEric Wald
When the database URL contains a port, uri.port is (at least in Python 2.7.6) an integer, not a string, so urlparse.unquote chokes on it. Fixes issue #536, but is probably worth verifying on Python 3.
2016-05-15Remove dead code and fix a broken test (all found by Codacy)koljonen
2016-04-27Unquote URI parts prior to using in connectionPavel Savchenko
As you know [RFC-3986][1] allows passing "disallowed" characters as long as these are percent encoded. Since we deal with the url parsing, we can expect this to happen and need to use the values after they have been decoded. [1]: https://tools.ietf.org/html/rfc3986#section-2.1
2016-02-03oh py2.6 how i don't miss youDavid Szotten
2016-02-03factor out `ensure_dir_exists` and use for logDavid Szotten
2016-02-03a few more testsDavid Szotten
2016-02-03ensure target dir exists when copying configDavid Szotten
2016-02-02test for recent patch for execute_from_fileDavid Szotten
to prevent obvious regressions at least
2015-11-22Add tests for the format_output.Amjith Ramanujam
2015-10-28Refactor a lot of `run_cli` into smaller submethods:Darik Gamble
`_build_cli`, '_evaluate_command` and `_handle_server_closed_connection` _evalute_command returns (output, MetaQuery) tuple where MetaQuery is a namedtuple (query, successful, total_time, meta_changed, db_changed, path_changed, mutated)
2015-10-26Setproctitle should be optional in tests.Iryna Cherniavska
2015-10-23Make setproctitle optional in WindowsAmjith Ramanujam
2015-10-19Clearer function name, handle passwords with spacesStuart Quin
2015-10-18Issue #355 Use setproctitle to hide command line passwordsStuart Quin
2015-10-03Fix need_completion_refreshDarik Gamble
Was only actually checking the first command in multiple commands