diff --git a/tests/covobs_test.py b/tests/covobs_test.py index bfb21dbf..6f0e47f1 100644 --- a/tests/covobs_test.py +++ b/tests/covobs_test.py @@ -70,3 +70,23 @@ def test_covobs_name_collision(): def test_covobs_replica_separator(): with pytest.raises(Exception): covobs = pe.cov_Obs(0.5, 0.002, 'test|r2') + + +def test_covobs_init(): + covobs = pe.cov_Obs(0.5, 0.002, 'test') + covobs = pe.cov_Obs([1, 2], [0.1, 0.2], 'test') + covobs = pe.cov_Obs([1, 2], np.array([0.1, 0.2]), 'test') + covobs = pe.cov_Obs([1, 2], [[0.1, 0.2], [0.1, 0.2]], 'test') + covobs = pe.cov_Obs([1, 2], np.array([[0.1, 0.2], [0.1, 0.2]]), 'test') + + + +def test_covobs_exceptions(): + with pytest.raises(Exception): + covobs = pe.cov_Obs(0.1, [[0.1, 0.2], [0.1, 0.2]], 'test') + with pytest.raises(Exception): + covobs = pe.cov_Obs(0.1, np.array([[0.1, 0.2], [0.1, 0.2]]), 'test') + with pytest.raises(Exception): + covobs = pe.cov_Obs([0.5, 0.1], np.array([[2, 1, 3], [1, 2, 3]]), 'test') + with pytest.raises(Exception): + covobs = pe.cov_Obs([0.5, 0.1], np.random.random((2, 2, 2)), 'test')