def test_run_resample_1(self): # shouldn't resample anything.. nex = NexusReader(os.path.join(EXAMPLE_DIR, 'example.trees')) new_nex = run_resample('1', nex, do_print=False) assert len(new_nex.trees.trees) == 3 assert new_nex.trees.ntrees == 3 assert new_nex.trees[0].startswith('tree tree.0.1065.603220') assert new_nex.trees[1].startswith('tree tree.10000.874.808756') assert new_nex.trees[2].startswith('tree tree.20000.883.396049')
def test_raises_error_on_invalid_resample_value(self): with self.assertRaises(ValueError): run_resample('a', self.nexus) with self.assertRaises(ValueError): run_resample(None, self.nexus) with self.assertRaises(ValueError): run_resample([], self.nexus)
def test_resample_one(self): newnex = run_resample(1, self.nexus) assert len(newnex.trees.trees) == 3