diff --git a/tests/test_priming_prob.py b/tests/test_priming_prob.py index 2be04d6599033add51a457f792fa1d6c2c6db8c3..5c1ba5bbb86190b22f440825d4fc28b60abdcfc4 100644 --- a/tests/test_priming_prob.py +++ b/tests/test_priming_prob.py @@ -29,7 +29,17 @@ def test_inter_prob(): mytestfile = open(Output_file, "r") # Test whether gff file start with transcript ID for mylinecounter in mytestfile: assert mylinecounter.startswith("NW_005196756.1:c68260-66684") + mytestfile.close() with open(Output_file, "r") as tt: # Check whether number of interactions is right x = len(tt.readlines()) assert x == 3 + + prob = open(Output_file, "r") # check if the sum of the probabilities is 1 + lines = prob.readlines() + probabilities = [] + for x in lines: + probabilities.append(float(x.split('\t')[5])) + prob.close() + + assert sum(probabilities) == 1 # sum should equal 1