Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_newick_long_args(self):
parser = cli.get_msp_parser()
cmd = "newick"
tree_sequence = "test.trees"
args = parser.parse_args([
cmd, tree_sequence, "--precision=5"])
self.assertEqual(args.tree_sequence, tree_sequence)
self.assertEqual(args.precision, 5)
def test_mutations_short_args(self):
parser = cli.get_msp_parser()
cmd = "mutations"
tree_sequence = "test.trees"
args = parser.parse_args([cmd, tree_sequence, "-p", "4"])
self.assertEqual(args.tree_sequence, tree_sequence)
self.assertEqual(args.precision, 4)
def test_vcf_default_values(self):
parser = cli.get_msp_parser()
cmd = "vcf"
tree_sequence = "test.trees"
args = parser.parse_args([cmd, tree_sequence])
self.assertEqual(args.tree_sequence, tree_sequence)
self.assertEqual(args.ploidy, 1)
def test_sites_default_values(self):
parser = cli.get_msp_parser()
cmd = "sites"
tree_sequence = "test.trees"
args = parser.parse_args([cmd, tree_sequence])
self.assertEqual(args.tree_sequence, tree_sequence)
self.assertEqual(args.precision, 6)
def test_edges_short_args(self):
parser = cli.get_msp_parser()
cmd = "edges"
tree_sequence = "test.trees"
args = parser.parse_args([cmd, tree_sequence, "-p", "8"])
self.assertEqual(args.tree_sequence, tree_sequence)
self.assertEqual(args.precision, 8)
def test_nodes_long_args(self):
parser = cli.get_msp_parser()
cmd = "nodes"
tree_sequence = "test.trees"
args = parser.parse_args([
cmd, tree_sequence, "--precision", "5"])
self.assertEqual(args.tree_sequence, tree_sequence)
self.assertEqual(args.precision, 5)
def test_simulate_default_values(self):
parser = cli.get_msp_parser()
cmd = "simulate"
args = parser.parse_args([cmd, "10", "out.trees"])
self.assertEqual(args.sample_size, 10)
self.assertEqual(args.tree_sequence, "out.trees")
self.assertEqual(args.recombination_rate, 0.0)
self.assertEqual(args.mutation_rate, 0.0)
self.assertEqual(args.length, 1)
self.assertEqual(args.effective_population_size, 1)
self.assertEqual(args.random_seed, None)
self.assertEqual(args.compress, False)
def test_provenances_short_args(self):
parser = cli.get_msp_parser()
cmd = "provenances"
tree_sequence = "test.trees"
args = parser.parse_args([cmd, tree_sequence, "-H"])
self.assertEqual(args.tree_sequence, tree_sequence)
self.assertEqual(args.human, True)
def test_macs_default_values(self):
parser = cli.get_msp_parser()
cmd = "macs"
tree_sequence = "test2.trees"
args = parser.parse_args([cmd, tree_sequence])
self.assertEqual(args.tree_sequence, tree_sequence)
def test_mutations_long_args(self):
parser = cli.get_msp_parser()
cmd = "mutations"
tree_sequence = "test.trees"
args = parser.parse_args([cmd, tree_sequence, "--precision", "9"])
self.assertEqual(args.tree_sequence, tree_sequence)
self.assertEqual(args.precision, 9)