Commit 6bc28655 authored by Venkat Malladi's avatar Venkat Malladi
Browse files

Merge branch '23-imaging_tests' into 'master'

Resolve "Add tests for imaging"

Closes #23

See merge request !8
parents d99b54f6 d5c343d7
Pipeline #5275 failed with stage
in 1 second
before_script:
- module add python/2.7.14-anaconda
- env
- module load python/3.7.x-anaconda
- conda env create --file environment.yml
stages:
- unit
user_configuration:
unit_tests:
stage: unit
script:
- source activate kce_etl
- pytest -m unit
- conda activate kce_etl
- pytest -m unit --cov=./scripts
after_script:
- conda deactivate
- conda env remove --name kce_etl -y
name: kce_etl
channels:
- conda-forge
- bioconda
- defaults
dependencies:
- conda-forge::pandas=0.24.2
pip:
- pytest-pythonpath==0.7.1
- pytest-cov==2.5.1
- _libgcc_mutex=0.1=main
- ca-certificates=2019.11.28=hecc5488_0
- certifi=2019.11.28=py38_0
- ld_impl_linux-64=2.33.1=h53a641e_7
- libblas=3.8.0=14_openblas
- libcblas=3.8.0=14_openblas
- libffi=3.2.1=he1b5a44_1006
- libgcc-ng=9.2.0=hdf63c60_0
- libgfortran-ng=7.3.0=hdf63c60_2
- liblapack=3.8.0=14_openblas
- libopenblas=0.3.7=h5ec1e0e_5
- libstdcxx-ng=9.2.0=hdf63c60_0
- ncurses=6.1=hf484d3e_1002
- numpy=1.17.3=py38h95a1406_0
- openssl=1.1.1d=h516909a_0
- pandas=0.24.2=py38hb3f55d8_1
- pip=19.3.1=py38_0
- python=3.8.0=h357f687_5
- python-dateutil=2.8.1=py_0
- pytz=2019.3=py_0
- readline=8.0=hf8c457e_0
- setuptools=42.0.2=py38_0
- six=1.13.0=py38_0
- sqlite=3.30.1=hcee41ef_0
- tk=8.6.10=hed695b0_0
- wheel=0.33.6=py38_0
- xz=5.2.4=h14c3975_1001
- zlib=1.2.11=h516909a_1006
- pip:
- attrs==19.3.0
- coverage==4.5.4
- more-itertools==8.0.2
- packaging==19.2
- pluggy==0.13.1
- py==1.8.0
- pyparsing==2.4.5
- pytest==5.3.1
- pytest-cov==2.5.1
- pytest-pythonpath==0.7.1
- wcwidth==0.1.7
#!/usr/bin/env python3
import pytest
import os
import pandas as pd
from StringIO import StringIO
import transform_imaging
IMAGE_STRING = """MRN,CPT,TYPE,C_NAME,START_DATE,OBSERVATION_BLOB
45,CPT:74160,CT,"(CPT:74160)Computed tomography, abdomen; with contrast material(s)",9/20/17 0:00,"AVM_VISIT_NUMBER:13348936;ICD9CODE:789.5; IDX PROCEDURE_NAME:CT, ABD, W/CONTRAST"
"""
@pytest.fixture
def image():
image_file = StringIO(IMAGE_STRING)
image_df = pd.read_csv(image_file)
return image_df
@pytest.mark.unit
def test_check_reformmat(image):
transform_immage = transform_imaging.reformat_record(image)
assert transform_immage.shape[1] == 4
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment