Esempio n. 1
0
    def test_record_basic(self):
        """Basic test on Record
        """

        r = FDist.Record()
        assert isinstance(r.data_org, int)
        assert isinstance(r.num_pops, int)
        assert isinstance(r.num_loci, int)
        assert isinstance(r.loci_data, list)
    def test_record_basic(self):
        """Basic test on Record
        """

        r = FDist.Record()
        assert type(r.data_org) == int
        assert type(r.num_pops) == int
        assert type(r.num_loci) == int
        assert type(r.loci_data) == list
 def test_record_parser(self):
     """Basic operation of the Record Parser.
     """
     for index in range(len(self.handles)):
         handle = self.handles[index]
         rec = FDist.read(handle)
         assert isinstance(rec, FDist.Record)
         assert rec.data_org == 0 #We don't support any other
         assert rec.num_pops, rec.num_loci == self.pops_loci[index]
         for i in range(len(self.num_markers[index])):
             assert rec.loci_data[i][0] == \
                    self.num_markers[index][i]
         for i in range(len(self.test_pos[index])):
             my_test_pos = self.test_pos[index]
             for test in my_test_pos:
                 locus, pop, pos, value = test
                 assert(rec.loci_data[locus][1][pop][pos] == value)
Esempio n. 4
0
 def test_record_parser(self):
     """Basic operation of the Record Parser.
     """
     for index in range(len(self.handles)):
         handle = self.handles[index]
         rec = FDist.read(handle)
         assert isinstance(rec, FDist.Record)
         assert rec.data_org == 0  # We don't support any other
         assert rec.num_pops, rec.num_loci == self.pops_loci[index]
         for i in range(len(self.num_markers[index])):
             assert rec.loci_data[i][0] == \
                    self.num_markers[index][i]
         for i in range(len(self.test_pos[index])):
             my_test_pos = self.test_pos[index]
             for test in my_test_pos:
                 locus, pop, pos, value = test
                 assert (rec.loci_data[locus][1][pop][pos] == value)