def test_add_analyses_option(self): cli = CLI("Test") cli.add_analyses_option() options,args = cli.parse_args(list()) self.assertEqual(options.analyses,'all') options,args = cli.parse_args(['--analyses=all',]) self.assertEqual(options.analyses,'all') options,args = cli.parse_args(['--analyses=peak_centric',]) self.assertEqual(options.analyses,'peak_centric') options,args = cli.parse_args(['--analyses=gene_centric',]) self.assertEqual(options.analyses,'gene_centric')
def test_add_edge_option(self): cli = CLI("Test") cli.add_edge_option() options,args = cli.parse_args(list()) self.assertEqual(options.edge,'tss') options,args = cli.parse_args(['--edge=tss',]) self.assertEqual(options.edge,'tss') options,args = cli.parse_args(['--edge=both',]) self.assertEqual(options.edge,'both')
def test_add_option_group(self): cli = CLI("Test") cli.add_option_group("Example options") cli.add_option('--attempts', dest='attempts', default=0, type=int, help="Number of attempts", group="Example options") options,args = cli.parse_args(list()) self.assertEqual(options.attempts,0) options,args = cli.parse_args(['--attempts=11',]) self.assertEqual(options.attempts,11)
def test_add_summary_option(self): cli = CLI("Test") cli.add_summary_option() options,args = cli.parse_args(list()) self.assertFalse(options.summary) options,args = cli.parse_args(['--summary',]) self.assertTrue(options.summary)
def test_add_compact_option(self): cli = CLI("Test") cli.add_compact_option() options,args = cli.parse_args(list()) self.assertFalse(options.compact) options,args = cli.parse_args(['--compact',]) self.assertTrue(options.compact)
def test_name_option(self): cli = CLI("Test") cli.add_name_option() options,args = cli.parse_args(list()) self.assertEqual(options.name,None) options,args = cli.parse_args(['--name=test',]) self.assertEqual(options.name,"test")
def test_add_promoter_region_option(self): cli = CLI("Test") cli.add_promoter_region_option() options,args = cli.parse_args(list()) self.assertEqual(options.promoter_region,"1000,100") options,args = cli.parse_args(['--promoter_region=1500,200',]) self.assertEqual(options.promoter_region,"1500,200")
def test_add_number_option(self): cli = CLI("Test") cli.add_number_option() options,args = cli.parse_args(list()) self.assertEqual(options.max_closest,None) options,args = cli.parse_args(['--number=9',]) self.assertEqual(options.max_closest,9)
def test_add_only_de_option(self): cli = CLI("Test") cli.add_only_de_option() options,args = cli.parse_args(list()) self.assertFalse(options.only_diff_expressed) options,args = cli.parse_args(['--only-DE',]) self.assertTrue(options.only_diff_expressed)
def test_add_peak_cols_option(self): cli = CLI("Test") cli.add_peak_cols_option() options,args = cli.parse_args(list()) self.assertEqual(options.peak_cols,None) options,args = cli.parse_args(['--peak_cols=3,1,2',]) self.assertEqual(options.peak_cols,"3,1,2")
def test_peak_id_option(self): cli = CLI("Test") cli.add_peak_id_option() options,args = cli.parse_args(list()) self.assertEqual(options.peak_id,None) options,args = cli.parse_args(['--peak_id=4',]) self.assertEqual(options.peak_id,4)
def test_feature_option(self): cli = CLI("Test") cli.add_feature_option() options,args = cli.parse_args(list()) self.assertEqual(options.feature_type,'gene') options,args = cli.parse_args(['--feature=transcript',]) self.assertEqual(options.feature_type,"transcript")
def test_add_xlsx_option(self): cli = CLI("Test") cli.add_xlsx_option() options,args = cli.parse_args(list()) self.assertFalse(options.xlsx_output) options,args = cli.parse_args(['--xlsx',]) self.assertTrue(options.xlsx_output)
def test_get_version(self): cli = CLI("Test",version="v1.0.2") self.assertEqual(cli.get_version(),"v1.0.2")