Compare commits

..

No commits in common. 'c659b7c9996b6a7beb088821a6d1c876eeb16e32' and 'a6f11b852579e5b345edbabcc5e5e8d209da0eef' have entirely different histories.

  1. 4
      Makefile
  2. 2
      RELEASE.txt
  3. 16
      scripttease/lib/commands/pgsql.py
  4. 6
      scripttease/version.py
  5. 8
      tests/test_lib_commands_pgsql.py
  6. 2
      tests/test_lib_factories.py

@ -51,7 +51,7 @@ docs: lines
cd docs && make html;
cd docs && make coverage;
open docs/build/coverage/python.txt;
firefox docs/build/html/index.html;
open docs/build/html/index.html;
#> clean - Remove pyc files and documentation builds.
clean:
@ -91,5 +91,5 @@ support:
tests:
coverage run --source=. -m pytest;
coverage html --directory=$(COVERAGE_PATH);
firefox $(COVERAGE_PATH)/index.html;
open $(COVERAGE_PATH)/index.html;

@ -1 +1 @@
7.1.5-a
7.1.0-a

@ -14,7 +14,6 @@ __all__ = (
"pgsql_exists",
"pgsql_grant",
"pgsql_load",
"pgsql_sql",
"pgsql_user",
)
@ -243,17 +242,6 @@ def pgsql_load(database, path, **kwargs):
return pgsql("psql", **kwargs)
def pgsql_sql(statement, database="template1", **kwargs):
kwargs.setdefault("comment", "run SQL statement")
kwargs['dbname'] = database
command = pgsql("psql", **kwargs)
command.statement += ' -c "%s"' % statement
return command
def pgsql_user(name, admin_pass=None, admin_user="postgres", op="create", password=None, **kwargs):
"""Work with a PostgreSQL user.
@ -290,7 +278,7 @@ def pgsql_user(name, admin_pass=None, admin_user="postgres", op="create", passwo
return pgsql("dropuser", name, password=admin_pass, user=admin_user, **kwargs)
elif op == "exists":
kwargs.setdefault("comment", "determine if %s postgres user exists" % name)
kwargs.setdefault("register", "pgsql_user_exists")
kwargs.setdefault("register", "pgsql_use_exists")
command = pgsql("psql", password=admin_pass, user=admin_user, **kwargs)
@ -309,6 +297,6 @@ PGSQL_MAPPINGS = {
'pgsql.dump': pgsql_dump,
'pgsql.exists': pgsql_exists,
'pgsql.grant': pgsql_grant,
'pgsql.sql': pgsql_sql,
# 'pgsql.sql': pgsql_exec,
'pgsql.user': pgsql_user,
}

@ -1,7 +1,7 @@
DATE = "2024-04-11"
VERSION = "7.1.5"
DATE = "2023-09-12"
VERSION = "7.1.1"
MAJOR = 7
MINOR = 1
PATCH = 5
PATCH = 1
STATUS = "a"

@ -71,14 +71,6 @@ def test_pgsql_load():
assert '--bogus=1' in s # to test passing any key
def test_pgsql_sql():
c = pgsql_sql("UPDATE etl_testing SET is_processed = 't'", database="example_app")
s = c.get_statement()
# psql -U postgres --host=localhost --port=5432 --dbname="example_app" -c "UPDATE etl_testing SET is_processed = 't'"
assert '--dbname="example_app"' in s
assert '-c "UPDATE etl_testing SET is_processed = \'t\'"' in s
def test_pgsql_user():
c = pgsql_user("testing", password="secret")
s = c.get_statement()

@ -21,7 +21,7 @@ def test_command_factory():
ini = INILoader("tests/examples/kitchen_sink.ini")
ini.load()
commands = command_factory(ini)
assert len(commands) == 49
assert len(commands) == 48
ini = INILoader("tests/examples/bad_command.ini")
ini.load()

Loading…
Cancel
Save