Skip to content

Commit

Permalink
Start Tests
Browse files Browse the repository at this point in the history
  • Loading branch information
odscjames committed Oct 3, 2023
1 parent 9538dec commit efaaa04
Show file tree
Hide file tree
Showing 6 changed files with 125 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Test
on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ '3.11']
steps:
- uses: actions/checkout@v2
- name: Setup python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- name: Install requirements_dev.txt
run: pip install -r requirements_dev.txt
- name: Test
run: py.test src/tests/
5 changes: 5 additions & 0 deletions requirements_dev.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
-r requirements.in

pip-tools
pytest

86 changes: 86 additions & 0 deletions requirements_dev.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
#
# This file is autogenerated by pip-compile with Python 3.11
# by the following command:
#
# pip-compile requirements_dev.in
#
azure-core==1.15.0
# via
# -r requirements.in
# azure-storage-blob
# azure-storage-queue
azure-storage-blob==12.6.0
# via -r requirements.in
azure-storage-queue==12.2.0
# via -r requirements.in
build==1.0.3
# via pip-tools
certifi==2023.7.22
# via
# msrest
# requests
cffi==1.16.0
# via cryptography
chardet==5.2.0
# via -r requirements.in
charset-normalizer==3.3.0
# via requests
click==8.1.7
# via pip-tools
cryptography==41.0.4
# via
# azure-storage-blob
# azure-storage-queue
idna==3.4
# via requests
iniconfig==2.0.0
# via pytest
isodate==0.6.1
# via msrest
lxml==4.9.3
# via -r requirements.in
msrest==0.6.21
# via
# azure-storage-blob
# azure-storage-queue
oauthlib==3.2.2
# via requests-oauthlib
packaging==23.2
# via
# build
# pytest
pip-tools==7.3.0
# via -r requirements_dev.in
pluggy==1.3.0
# via pytest
psycopg2==2.9.9
# via -r requirements.in
pycparser==2.21
# via cffi
pyproject-hooks==1.0.0
# via build
pysolr==3.9.0
# via -r requirements.in
pytest==7.4.2
# via -r requirements_dev.in
requests==2.31.0
# via
# -r requirements.in
# azure-core
# msrest
# pysolr
# requests-oauthlib
requests-oauthlib==1.3.1
# via msrest
six==1.16.0
# via
# azure-core
# isodate
urllib3==2.0.6
# via requests
wheel==0.41.2
# via pip-tools

# The following packages are considered to be unsafe in a requirements file:
# pip
# setuptools
Empty file added src/tests/__init__.py
Empty file.
9 changes: 9 additions & 0 deletions src/tests/test_solrize.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from library.solrize import validateLatLon

def test_validateLatLon_pass_1():
assert "1.0,1.0" == validateLatLon("1 1")


def test_validateLatLon_fail_1():
assert validateLatLon("1 1000") is None

5 changes: 5 additions & 0 deletions src/tests/test_utils.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from library.utils import get_hash_for_identifier

def test_get_hash_for_identifier_1():
assert "9d989e8d27dc9e0ec3389fc855f142c3d40f0c50" == get_hash_for_identifier("cat")

0 comments on commit efaaa04

Please sign in to comment.