Skip to content

Commit

Permalink
fix: unit test paths
Browse files Browse the repository at this point in the history
  • Loading branch information
Joe-Heffer-Shef committed Jun 18, 2024
1 parent e6ea209 commit 4e82f3f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions backend/tests/test_photo.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
import random
from http import HTTPStatus
from pathlib import Path

import flask
import numpy as np

from btviewer.blueprints.photo.model import Photo


def test_photo_array(app):
with app.app_context():
photo = Photo('1970-01-01/set_A/device_1234/camera_1/20200101_094359.123456_000002.np')
photo = Photo('2020-01-01/set_A/device_1/camera_1/20200101_094359.123456_000001.np')

assert isinstance(photo.array, np.ndarray)
assert photo.array.shape == (1536, 2048)
Expand All @@ -18,7 +21,7 @@ def test_photo_array(app):
def test_photo_jpeg(client):
width = 1024
height = 768
response = client.get('/photos/1970-01-01/set_A/device_1234/camera_1/20200101_094359.123456_000002.jpeg')
response = client.get('photos/2020-01-01/set_A/device_1/camera_1/20200101_094359.123456_000001.jpeg')
assert response.status_code == HTTPStatus.OK

# Check response contents
Expand Down

0 comments on commit 4e82f3f

Please sign in to comment.