ndif-team/ndif

Set up basic pytest unit tests for API service

开放

#172 创建于 2025年10月20日

 (0 条评论) (0 个反应) (0 位负责人)Python (17 个派生)github user discovery
enhancementgood first issuehelp wanted

仓库指标

星标
 (45 个星标)
PR 合并指标
 (平均合并 7小时 27分钟) (30 天内合并 4 个 PR)

描述

Description

Currently, NDIF has very few tests written for it, with the barrier to entry being the lack of an existing testing framework. Getting basic unit tests set up with pytest will both help make it easier to start writing more tests and would set the foundations for developing a more diverse testing suite (integration, end-to-end, ..)

Goal

Have a way of running unit tests (that can be run without spinning up the service). The following would meet the requirements of completing this ticket:

  • From src/services/api, have a pytest config, and be able to run unit tests from command line
  • Add (at least) 4 basic tests, one which is basically a "hello world" test, one which tests something from auth.py, one from app.py. and one from util.py
  • Instructions on how to run tests added to README, and informative doc strings.

See the Queue service for an example of what this could look like (ignore the actual tests, they serve more as "proof of concept").

贡献者指南