Skip to content

Commit

Permalink
biology function test refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
ericmjl committed Jan 29, 2019
1 parent f394510 commit 137a754
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 27 deletions.
10 changes: 10 additions & 0 deletions janitor/testing_utils/fixtures.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import numpy as np
import pandas as pd
import pytest
from pathlib import Path


TEST_DATA_DIR = Path(__file__).resolve().parent.parent.parent / "tests" / "test_data"


@pytest.fixture
Expand Down Expand Up @@ -74,3 +78,9 @@ def missingdata_df():
}
df = pd.DataFrame(data)
return df


@pytest.fixture
def biodf():
df = pd.read_csv(TEST_DATA_DIR / "sequences.tsv", sep="\t").clean_names()
return df
13 changes: 13 additions & 0 deletions tests/biology/test_join_fasta.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import janitor.biology
import pytest

from janitor.testing_utils.fixtures import TEST_DATA_DIR, biodf


@pytest.mark.biology
def test_join_fasta(biodf):
df = biodf.join_fasta(
TEST_DATA_DIR / "sequences.fasta", "sequence_accession", "sequence"
)

assert "sequence" in df.columns
27 changes: 0 additions & 27 deletions tests/test_biology.py

This file was deleted.

0 comments on commit 137a754

Please sign in to comment.