Skip to content
This repository has been archived by the owner on May 14, 2024. It is now read-only.

Remove unused code. #334

Open
wants to merge 2 commits into
base: 0.9
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 0 additions & 27 deletions orator/utils/url.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,33 +141,6 @@ def get_dialect(self):
else:
return cls

def translate_connect_args(self, names=[], **kw):
"""Translate url attributes into a dictionary of connection arguments.

Returns attributes of this url (`host`, `database`, `username`,
`password`, `port`) as a plain dictionary. The attribute names are
used as the keys by default. Unset or false attributes are omitted
from the final dictionary.

:param \**kw: Optional, alternate key names for url attributes.

:param names: Deprecated. Same purpose as the keyword-based alternate
names, but correlates the name to the original positionally.
"""

translated = {}
attribute_names = ["host", "database", "username", "password", "port"]
for sname in attribute_names:
if names:
name = names.pop(0)
elif sname in kw:
name = kw[sname]
else:
name = sname
if name is not None and getattr(self, sname, False):
translated[name] = getattr(self, sname)
return translated


def make_url(name_or_url):
"""Given a string or unicode instance, produce a new URL instance.
Expand Down
2 changes: 1 addition & 1 deletion tests/commands/migrations/test_make_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def test_basic_create_gives_creator_proper_arguments_when_table_is_set(self):
self.run_command(command, [("name", "create_foo"), ("--table", "users")])

def test_basic_create_gives_creator_proper_arguments_when_table_is_set_with_create(
self
self,
):
creator_mock = flexmock(MigrationCreator)
creator_mock.should_receive("create").once().with_args(
Expand Down
2 changes: 1 addition & 1 deletion tests/migrations/test_migrator.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ def test_last_batch_of_migrations_can_be_rolled_back(self):
migrator.rollback(os.getcwd())

def test_last_batch_of_migrations_can_be_rolled_back_directly_if_transactional_is_false(
self
self,
):
resolver_mock = flexmock(DatabaseManager)
resolver_mock.should_receive("connection").and_return({})
Expand Down