Skip to content

Commit

Permalink
make test
Browse files Browse the repository at this point in the history
  • Loading branch information
drernie committed Aug 12, 2024
1 parent b22ff7c commit 7f98277
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 1 deletion.
28 changes: 28 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Install project dependencies
install:
poetry install

# Update project dependencies
update:
poetry update

# Run project tests
test:
poetry run pytest

# Lint code using flake8
lint:
black .
flake8

# Clean up generated files
clean:
poetry run rm -rf dist build

# Build project distribution
build:
poetry build

# Publish project to PyPI
publish:
poetry publish
7 changes: 7 additions & 0 deletions athena_federation/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
"""Version number of our project"""

__version__ = "0.0.3"

# Import the SDK
from .athena_data_source import AthenaDataSource # noqa: F401
from .lambda_handler import AthenaLambdaHandler # noqa: F401
from .models import * # noqa: F401,F403
from .sdk import AthenaFederationSDK # noqa: F401
from .utils import AthenaSDKUtils # noqa: F401
4 changes: 3 additions & 1 deletion athena_federation/lambda_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,9 @@ def GetSplitsRequest(self) -> models.GetSplitsResponse:

## END: Unimplmented placehodlders

def ReadRecordsRequest(self) -> Union[models.ReadRecordsResponse, models.RemoteReadRecordsResponse]:
def ReadRecordsRequest(
self,
) -> Union[models.ReadRecordsResponse, models.RemoteReadRecordsResponse]:
schema = AthenaSDKUtils.parse_encoded_schema(self.event["schema"]["schema"])
database_name = self.event.get("tableName").get("schemaName")
table_name = self.event.get("tableName").get("tableName")
Expand Down
8 changes: 8 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,11 @@ black = "^20.8b1"
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

[tool.pytest.ini_options]
testpaths = ["tests"]
filterwarnings = [
"error",
# change in Python 3.12 beta causes warning from inside pytest
"ignore:ast:DeprecationWarning",
]
11 changes: 11 additions & 0 deletions tests/test_import.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import athena_federation


def test_import():
assert athena_federation.AthenaLambdaHandler
assert athena_federation.AthenaFederationSDK
assert athena_federation.AthenaDataSource
assert athena_federation.AthenaFederationSDK
assert athena_federation.AthenaSDKUtils
assert athena_federation.models.PingResponse
assert athena_federation.models.ListSchemasResponse

0 comments on commit 7f98277

Please sign in to comment.