Skip to content

Commit

Permalink
Started tests for nuclinfo
Browse files Browse the repository at this point in the history
  • Loading branch information
richardjgowers committed Mar 20, 2016
1 parent 3de4db6 commit 33e15b6
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions testsuite/MDAnalysisTests/analysis/test_nuclinfo.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; coding:utf-8 -*-
# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 fileencoding=utf-8
#
# MDAnalysis --- http://www.MDAnalysis.org
# Copyright (c) 2006-2015 Naveen Michaud-Agrawal, Elizabeth J. Denning, Oliver
# Beckstein and contributors (see AUTHORS for the full list)
#
# Released under the GNU Public Licence, v2 or any higher version
#
# Please cite your use of MDAnalysis in published work:
#
# N. Michaud-Agrawal, E. J. Denning, T. B. Woolf, and O. Beckstein.
# MDAnalysis: A Toolkit for the Analysis of Molecular Dynamics Simulations.
# J. Comput. Chem. 32 (2011), 2319--2327, doi:10.1002/jcc.21787
#

from numpy.testing import (
assert_,
assert_almost_equal,
)

import MDAnalysis as mda
from MDAnalysis.analysis import nuclinfo

from MDAnalysisTests.datafiles import NUCL


class TestNuclinfo(object):
def setUp(self):
self.u = mda.Universe(NUCL)

def tearDown(self):
del self.u

def test_wc_pair_1(self):
val = nuclinfo.wc_pair(self.u, 1, 2, seg1='RNAA', seg2='RNAA')

assert_almost_equal(val, 4.449, decimal=3)

def test_wc_pair_2(self):
val = nuclinfo.wc_pair(self.u, 22, 23, seg1='RNAA', seg2='RNAA')
assert_almost_equal(val, 4.601, decimal=3)

0 comments on commit 33e15b6

Please sign in to comment.