Back to index

python-biopython  1.60
Public Member Functions
test_PopGen_SimCoal_nodepend.TemplateTest Class Reference

List of all members.

Public Member Functions

def test_template_full
def tearDown

Detailed Description

Definition at line 15 of file test_PopGen_SimCoal_nodepend.py.


Member Function Documentation

Definition at line 36 of file test_PopGen_SimCoal_nodepend.py.

00036 
00037     def tearDown(self):
00038         if os.path.isfile(os.path.join('PopGen', 'tmp.par')):
00039             #This is a temp file create by the Bio.PopGen.SimCoal.Template
00040             #function generate_simcoal_from_template
00041             os.remove(os.path.join('PopGen', 'tmp.par'))
00042         if os.path.isfile(os.path.join('PopGen', 'simple_100_30.par')):
00043             #This won't exist if the template generation failed:
00044             os.remove(os.path.join('PopGen', 'simple_100_30.par'))

Full template creation test

Definition at line 16 of file test_PopGen_SimCoal_nodepend.py.

00016 
00017     def test_template_full(self):
00018         """Full template creation test
00019         """
00020         generate_simcoal_from_template('simple',
00021             [(1, [('SNP', [24, 0.0005, 0.0])])],
00022             [('sample_size', [30]),
00023              ('pop_size', [100])],
00024             'PopGen')
00025         #Confirm the files match (ignoring any switch of line endings
00026         #possible if the input file used a different OS convention)
00027         handle = open(os.path.join('PopGen', 'simple.par'), "rU")
00028         old = handle.readlines()
00029         handle.close()
00030         handle = open(os.path.join('PopGen', 'simple_100_30.par'))
00031         new = handle.readlines()
00032         handle.close()
00033         assert old==new, "Error - Old:\n%s\n\nNew:\n%s\n" % (old, new)
00034         #assert(os.stat('PopGen' + os.sep + 'simple.par').st_size ==
00035         #       os.stat('PopGen' + os.sep + 'simple_100_30.par').st_size)

Here is the call graph for this function:


The documentation for this class was generated from the following file: