Spaces:
Sleeping
Sleeping
Badrivishal Paurana commited on
Commit ·
050b55f
1
Parent(s): e5f210d
Tests
Browse files- .github/workflows/test.yml +16 -0
- test/test_app.py +12 -0
.github/workflows/test.yml
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
name: Test Code
|
| 2 |
+
|
| 3 |
+
on:
|
| 4 |
+
push:
|
| 5 |
+
branches: [test]
|
| 6 |
+
|
| 7 |
+
jobs:
|
| 8 |
+
test:
|
| 9 |
+
runs-on: ubuntu-latest
|
| 10 |
+
steps:
|
| 11 |
+
- uses: actions/checkout@v3
|
| 12 |
+
with:
|
| 13 |
+
fetch-depth: 0
|
| 14 |
+
lfs: true
|
| 15 |
+
- name: Test Code
|
| 16 |
+
run: pytest
|
test/test_app.py
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import pytest
|
| 2 |
+
from app import build_index, respond
|
| 3 |
+
|
| 4 |
+
def test_build_index():
|
| 5 |
+
index, meta = build_index()
|
| 6 |
+
assert index is not None
|
| 7 |
+
assert meta is not None
|
| 8 |
+
|
| 9 |
+
def test_respond():
|
| 10 |
+
respond("I need a comic about procrastination.")
|
| 11 |
+
assert response is str
|
| 12 |
+
|