Ejemplo n.º 1
0
    def test_mboxes_path_init(self, mock_expanduser):
        """Test dirpath initialization"""

        mock_expanduser.return_value = 'testpath'
        setup_http_server()

        args = ['*****@*****.**']

        cmd = GmaneCommand(*args)
        self.assertEqual(cmd.parsed_args.dirpath,
                         'testpath/[email protected]')

        args = ['*****@*****.**', '--mboxes-path', '/tmp/perceval/']

        cmd = GmaneCommand(*args)
        self.assertEqual(cmd.parsed_args.dirpath, '/tmp/perceval/')
Ejemplo n.º 2
0
    def test_setup_cmd_parser(self):
        """Test if it parser object is correctly initialized"""

        parser = GmaneCommand.setup_cmd_parser()
        self.assertIsInstance(parser, BackendCommandArgumentParser)

        args = ['*****@*****.**',
                '--mboxes-path', '/tmp/perceval/',
                '--offset', '10',
                '--tag', 'test',
                '--no-cache']

        parsed_args = parser.parse(*args)
        self.assertEqual(parsed_args.mailing_list_address, '*****@*****.**')
        self.assertEqual(parsed_args.mboxes_path, '/tmp/perceval/')
        self.assertEqual(parsed_args.offset, 10)
        self.assertEqual(parsed_args.tag, 'test')
        self.assertEqual(parsed_args.no_cache, True)