From cda6c5767dfa78fe88243c562b23afb28cf4f541 Mon Sep 17 00:00:00 2001 From: Vedant Rathore Date: Mon, 23 Jan 2017 22:35:13 +0530 Subject: [PATCH] Added exception and unittest for dist_mat_to_vec of analysis/psa.py (Part of #597) --- testsuite/MDAnalysisTests/analysis/test_psa.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/testsuite/MDAnalysisTests/analysis/test_psa.py b/testsuite/MDAnalysisTests/analysis/test_psa.py index 24cefdb917a..64443a797ba 100644 --- a/testsuite/MDAnalysisTests/analysis/test_psa.py +++ b/testsuite/MDAnalysisTests/analysis/test_psa.py @@ -138,7 +138,13 @@ def test_dist_mat_to_vec_func_out_of_bounds(self): # Check if both i and j are out of bounds of N with self.assertRaises(ValueError): - PSA.dist_mat_to_vec(5, 6, 6) + PSA.dist_mat_to_vec(5, 6, 7) + + def test_dist_mat_to_vec_func_i_equals_j(self): + """Test that ValueError is raised when i == j""" + + with self.assertRaises(ValueError): + PSA.dist_mat_to_vec(5, 4, 4) def test_dist_mat_to_vec_func_bad_integers(self): """Test that ValueError is raised when i or j are