Skip to content

Commit

Permalink
main: fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
balinthaller committed Feb 26, 2021
1 parent 18a9f62 commit da27ad0
Show file tree
Hide file tree
Showing 8 changed files with 229 additions and 34 deletions.
5 changes: 4 additions & 1 deletion carte_cli/utils/config_parser.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import io
import importlib
from ruamel.yaml import YAML
from carte_cli.extractor.glue_extractor import GlueExtractor
from databuilder.extractor.postgres_metadata_extractor import PostgresMetadataExtractor

yaml = YAML()

Expand All @@ -13,6 +13,9 @@ def create_glue_connection(conn_dict):


def create_postgres_connection(conn_dict):
PostgresMetadataExtractor = importlib.import_module(
"databuilder.extractor.postgres_metadata_extractor"
).PostgresMetadataExtractor
extractor = PostgresMetadataExtractor()
extractor_scope = extractor.get_scope()
config = conn_dict.get(CONFIG_KEY, {})
Expand Down
2 changes: 1 addition & 1 deletion carte_cli/utils/frontmatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def parse(filename):
if len(data) >= 2 and data[1] != "":
metadata = yaml.load(data[1])

if len(data) >= 2:
if len(data) >= 3:
content = data[2]

return metadata, content
Expand Down
197 changes: 193 additions & 4 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ SQLAlchemy = { version = "^1.3.23", optional = true }
[tool.poetry.extras]
postgres = ["psycopg2", "SQLAlchemy"]

[tool.poetry.dev-dependencies]
pytest = "^6.2.2"

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
Loading

0 comments on commit da27ad0

Please sign in to comment.