Back to index

python-biopython  1.60
Public Member Functions | Public Attributes
test_PopGen_FDist_nodepend.ParserTest Class Reference

List of all members.

Public Member Functions

def setUp
def tearDown
def test_record_parser

Public Attributes

 handles
 pops_loci
 num_markers
 test_pos

Detailed Description

Definition at line 28 of file test_PopGen_FDist_nodepend.py.


Member Function Documentation

Definition at line 29 of file test_PopGen_FDist_nodepend.py.

00029 
00030     def setUp(self):
00031         files = ["fdist1"]
00032         self.handles = []
00033         for filename in files:
00034             self.handles.append(open(os.path.join("PopGen", filename)))
00035 
00036         self.pops_loci = [
00037             (3, 4)
00038         ]
00039         self.num_markers = [
00040             [2, 3, 4, 2]
00041         ]
00042         #format is locus, pop, position, value
00043         self.test_pos = [
00044             [
00045                 (0, 0, 0, 5),
00046                 (3, 2, 0, 5)
00047             ]
00048         ]

Definition at line 49 of file test_PopGen_FDist_nodepend.py.

00049 
00050     def tearDown(self):
00051         for handle in self.handles:
00052             handle.close()

Basic operation of the Record Parser.

Definition at line 53 of file test_PopGen_FDist_nodepend.py.

00053 
00054     def test_record_parser(self):
00055         """Basic operation of the Record Parser.
00056         """
00057         for index in range(len(self.handles)):
00058             handle = self.handles[index]
00059             rec = FDist.read(handle)
00060             assert isinstance(rec, FDist.Record)
00061             assert rec.data_org == 0 #We don't support any other
00062             assert rec.num_pops, rec.num_loci == self.pops_loci[index]
00063             for i in range(len(self.num_markers[index])):
00064                 assert rec.loci_data[i][0] == \
00065                        self.num_markers[index][i]
00066             for i in range(len(self.test_pos[index])):
00067                 my_test_pos = self.test_pos[index]
00068                 for test in my_test_pos:
00069                     locus, pop, pos, value = test
00070                     assert(rec.loci_data[locus][1][pop][pos] == value)


Member Data Documentation

Definition at line 31 of file test_PopGen_FDist_nodepend.py.

Definition at line 38 of file test_PopGen_FDist_nodepend.py.

Definition at line 35 of file test_PopGen_FDist_nodepend.py.

Definition at line 42 of file test_PopGen_FDist_nodepend.py.


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