Back to index

python-biopython  1.60
Public Member Functions | Public Attributes
test_PopGen_GenePop_nodepend.UtilsTest Class Reference

List of all members.

Public Member Functions

def setUp
def tearDown
def test_utils

Public Attributes

 handles

Detailed Description

Definition at line 121 of file test_PopGen_GenePop_nodepend.py.


Member Function Documentation

Definition at line 122 of file test_PopGen_GenePop_nodepend.py.

00122 
00123     def setUp(self):
00124         #All files have to have at least 3 loci and 2 pops
00125         files = ["c2line.gen"]
00126         self.handles = []
00127         for filename in files:
00128             self.handles.append(open(os.path.join("PopGen", filename)))
00129 

Definition at line 130 of file test_PopGen_GenePop_nodepend.py.

00130 
00131     def tearDown(self):
00132         for handle in self.handles:
00133             handle.close()

Basic operation of GenePop Utils.

Definition at line 134 of file test_PopGen_GenePop_nodepend.py.

00134 
00135     def test_utils(self):
00136         """Basic operation of GenePop Utils.
00137         """
00138         for index in range(len(self.handles)):
00139             handle = self.handles[index]
00140             rec = GenePop.read(handle)
00141         initial_pops = len(rec.populations)
00142         initial_loci = len(rec.loci_list)
00143         first_loci = rec.loci_list[0]
00144         rec.remove_population(0)
00145         assert len(rec.populations) == initial_pops - 1
00146         rec.remove_locus_by_name(first_loci)
00147         assert len(rec.loci_list) == initial_loci - 1
00148         assert rec.loci_list[0] != first_loci
00149         rec.remove_locus_by_position(0)
00150         assert len(rec.loci_list) == initial_loci - 2


Member Data Documentation

Definition at line 125 of file test_PopGen_GenePop_nodepend.py.


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