Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding unit tests #36

Merged
merged 3 commits into from
Feb 3, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file removed bitc/__main__.py
Empty file.
15 changes: 15 additions & 0 deletions bitc/tests/test_bitc.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import unittest


class TestImports(unittest.TestCase):
"""Test if all submodules import properly.
"""
def _imports(self, mod):
from types import ModuleType
self.assertIsInstance(__import__(mod), ModuleType)

def test_imports(self):
"""Test the importing of all libraries."""
module_names = ['models', 'experiments', 'instruments', 'report', 'units']
for mod in module_names:
self._imports('bitc.' + mod)
78 changes: 78 additions & 0 deletions bitc/tests/test_experiments.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
import unittest

class TestInjection(unittest.TestCase):
@unittest.expectedFailure
def test___init__(self):
# injection = Injection(number, volume, duration, spacing, filter_period, titrant_concentration)
assert False # TODO: implement your test here
@unittest.expectedFailure
def test_contents(self):
# injection = Injection(number, volume, duration, spacing, filter_period, titrant_concentration)
# self.assertEqual(expected, injection.contents(titrant_concentration))
assert False # TODO: implement your test here

class TestExperiment(unittest.TestCase):
@unittest.expectedFailure
def test___init__(self):
# experiment = Experiment(data_filename)
assert False # TODO: implement your test here

@unittest.expectedFailure
def test___str__(self):
# experiment = Experiment(data_filename)
# self.assertEqual(expected, experiment.__str__())
assert False # TODO: implement your test here


@unittest.expectedFailure
def test_fit_gaussian_process_baseline(self):
# experiment = Experiment(data_filename)
# self.assertEqual(expected, experiment.fit_gaussian_process_baseline(frac, theta0, nugget, plot))
assert False # TODO: implement your test here


@unittest.expectedFailure
def test_integrate_heat(self):
# experiment = Experiment(data_filename)
# self.assertEqual(expected, experiment.integrate_heat())
assert False # TODO: implement your test here


@unittest.expectedFailure
def test_plot(self):
# experiment = Experiment(data_filename)
# self.assertEqual(expected, experiment.plot(filename, model))
assert False # TODO: implement your test here

@unittest.expectedFailure
def test_plot_baseline(self):
# experiment = Experiment(data_filename)
# self.assertEqual(expected, experiment.plot_baseline(filename))
assert False # TODO: implement your test here

@unittest.expectedFailure
def test_read_integrated_heats(self):
# experiment = Experiment(data_filename)
# self.assertEqual(expected, experiment.read_integrated_heats(heats_file, unit))
assert False # TODO: implement your test here

@unittest.expectedFailure
def test_write_heats_csv(self):
# experiment = Experiment(data_filename)
# self.assertEqual(expected, experiment.write_heats_csv(filename))
assert False # TODO: implement your test here

@unittest.expectedFailure
def test_write_integrated_heats(self):
# experiment = Experiment(data_filename)
# self.assertEqual(expected, experiment.write_integrated_heats(filename))
assert False # TODO: implement your test here

@unittest.expectedFailure
def test_write_power(self):
# experiment = Experiment(data_filename)
# self.assertEqual(expected, experiment.write_power(filename))
assert False # TODO: implement your test here

if __name__ == '__main__':
unittest.main()
29 changes: 29 additions & 0 deletions bitc/tests/test_instruments.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import unittest

class TestInstrument(unittest.TestCase):

@unittest.expectedFailure
def test___init__(self):
# instrument = Instrument(V0, V_correction, itcfile, description)
assert False # TODO: implement your test here

@unittest.expectedFailure
def test_instrument_from_file(self):
# instrument = Instrument(V0, V_correction, itcfile, description)
# self.assertEqual(expected, instrument.instrument_from_file(filename))
assert False # TODO: implement your test here

class TestVPITC(unittest.TestCase):
@unittest.expectedFailure
def test___init__(self):
# v_pit_c = VPITC()
assert False # TODO: implement your test here

class TestITC200(unittest.TestCase):
@unittest.expectedFailure
def test___init__(self):
# i_t_c200 = ITC200()
assert False # TODO: implement your test here

if __name__ == '__main__':
unittest.main()
85 changes: 85 additions & 0 deletions bitc/tests/test_models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
import unittest

class TestRescalingStep(unittest.TestCase):
@unittest.expectedFailure
def test___init__(self):
# rescaling_step = RescalingStep(dictionary, beta, max_scale, interval, verbose)
assert False # TODO: implement your test here

@unittest.expectedFailure
def test_competence(self):
# rescaling_step = RescalingStep(dictionary, beta, max_scale, interval, verbose)
# self.assertEqual(expected, rescaling_step.competence(stochastic))
assert False # TODO: implement your test here

@unittest.expectedFailure
def test_propose(self):
# rescaling_step = RescalingStep(dictionary, beta, max_scale, interval, verbose)
# self.assertEqual(expected, rescaling_step.propose())
assert False # TODO: implement your test here

@unittest.expectedFailure
def test_reject(self):
# rescaling_step = RescalingStep(dictionary, beta, max_scale, interval, verbose)
# self.assertEqual(expected, rescaling_step.reject())
assert False # TODO: implement your test here

@unittest.expectedFailure
def test_step(self):
# rescaling_step = RescalingStep(dictionary, beta, max_scale, interval, verbose)
# self.assertEqual(expected, rescaling_step.step())
assert False # TODO: implement your test here

@unittest.expectedFailure
def test_tune(self):
# rescaling_step = RescalingStep(dictionary, beta, max_scale, interval, verbose)
# self.assertEqual(expected, rescaling_step.tune(verbose))
assert False # TODO: implement your test here


class TestBindingModel(unittest.TestCase):
@unittest.expectedFailure
def test___init__(self):
# binding_model = BindingModel()
assert False # TODO: implement your test here


class TestTwoComponentBindingModel(unittest.TestCase):
@unittest.expectedFailure
def test___init__(self):
# two_component_binding_model = TwoComponentBindingModel(experiment, instrument)
assert False # TODO: implement your test here

@unittest.expectedFailure
def test_expected_injection_heats(self):
# two_component_binding_model = TwoComponentBindingModel(experiment, instrument)
# self.assertEqual(expected, two_component_binding_model.expected_injection_heats(DeltaVn, P0, Ls, DeltaG, DeltaH, DeltaH_0, beta, N))
assert False # TODO: implement your test here

@unittest.expectedFailure
def test_tau(self):
# two_component_binding_model = TwoComponentBindingModel(experiment, instrument)
# self.assertEqual(expected, two_component_binding_model.tau())
assert False # TODO: implement your test here


class TestCompetitiveBindingModel(unittest.TestCase):
@unittest.expectedFailure
def test___init__(self):
# competitive_binding_model = CompetitiveBindingModel(experiments, receptor, V0, concentration_uncertainty, verbose)
assert False # TODO: implement your test here

@unittest.expectedFailure
def test_equilibrium_concentrations(self):
# competitive_binding_model = CompetitiveBindingModel(experiments, receptor, V0, concentration_uncertainty, verbose)
# self.assertEqual(expected, competitive_binding_model.equilibrium_concentrations(Ka_n, C0_R, C0_Ln, V, c0))
assert False # TODO: implement your test here

@unittest.expectedFailure
def test_expected_injection_heats(self):
# competitive_binding_model = CompetitiveBindingModel(experiments, receptor, V0, concentration_uncertainty, verbose)
# self.assertEqual(expected, competitive_binding_model.expected_injection_heats(experiment, true_sample_cell_concentrations, true_syringe_concentrations, DeltaH_0, thermodynamic_parameters))
assert False # TODO: implement your test here

if __name__ == '__main__':
unittest.main()
10 changes: 10 additions & 0 deletions bitc/tests/test_parser.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import unittest

class TestOptparser(unittest.TestCase):
@unittest.expectedFailure
def test_optparser(self):
# self.assertEqual(expected, optparser(argv))
assert False # TODO: implement your test here

if __name__ == '__main__':
unittest.main()
22 changes: 22 additions & 0 deletions bitc/tests/test_report.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import unittest

class TestReport(unittest.TestCase):
@unittest.expectedFailure
def test___init__(self):
# report = Report(experiments)
assert False # TODO: implement your test here

@unittest.expectedFailure
def test_writeLaTeX(self):
# report = Report(experiments)
# self.assertEqual(expected, report.writeLaTeX(filename))
assert False # TODO: implement your test here

class TestAnalyze(unittest.TestCase):
@unittest.expectedFailure
def test_analyze(self):
# self.assertEqual(expected, analyze(name, experiment))
assert False # TODO: implement your test here

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