Skip to content

Commit

Permalink
A couple of tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
davipatti committed Jul 17, 2018
1 parent d37729a commit b82939c
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions test/test-antigenic.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/usr/bin/env python3

import os
import unittest

import numpy as np
import pandas as pd

import pymds
from pymds.antigenic import Table


class TestTable(unittest.TestCase):
"""Tests for pymds.antigenic.Table."""

def test_D_has_correct_shape(self):
df = pd.DataFrame(
2 ** np.random.randint(low=0, high=8, size=(10, 4)) * 10)
t = Table(df)
self.assertEqual((14, 14), t.D.shape)

def test_optimize(self):
path = os.path.join(
pymds.__path__[0], '..', 'test', 'data', 'hi_table.csv')
df = pd.read_csv(path, index_col=0)
self.assertTrue(False) # Have to handle <10 values

if __name__ == '__main__':
unittest.main()

0 comments on commit b82939c

Please sign in to comment.