Esempio n. 1
0
    def test_parse_nginx_config_reloader_arguments_adds_options(self):
        parse_nginx_config_reloader_arguments()

        expected_calls = [
            call('--monitor',
                 '-m',
                 action='store_true',
                 help='Monitor files on foreground with output'),
            call('--nomagentoconfig',
                 action='store_true',
                 help='Disable Magento configuration',
                 default=False),
            call('--nocustomconfig',
                 action='store_true',
                 help='Disable copying custom configuration',
                 default=False),
            call('--watchdir',
                 '-w',
                 help='Set directory to watch',
                 default=nginx_config_reloader.DIR_TO_WATCH),
            call('--recursivewatch',
                 action='store_true',
                 help='Enable recursive watching of subdirectories',
                 default=False)
        ]
        self.assertEqual(self.parser.return_value.add_argument.mock_calls,
                         expected_calls)
Esempio n. 2
0
    def test_parse_nginx_config_reloader_arguments_adds_options(self):
        parse_nginx_config_reloader_arguments()

        expected_calls = [
            call("--daemon", '-d', action='store_true',
                 help='Fork to background and run as daemon'),
            call('--monitor', '-m', action='store_true',
                 help='Monitor files on foreground with output'),
            call('--allow-includes', action='store_true',
                 help='Allow the config to contain includes outside of'
                      ' the system nginx config directory (default False)')
        ]
        self.assertEqual(
            self.parser.return_value.add_argument.mock_calls, expected_calls
        )
    def test_parse_nginx_config_reloader_arguments_adds_options(self):
        parse_nginx_config_reloader_arguments()

        expected_calls = [
            call('--monitor', '-m', action='store_true',
                 help='Monitor files on foreground with output'),
            call('--nomagentoconfig', action='store_true',
                 help='Disable Magento configuration', default=False),
            call('--nocustomconfig', action='store_true',
                 help='Disable copying custom configuration', default=False),
            call('--watchdir', '-w',
                help='Set directory to watch', default=nginx_config_reloader.DIR_TO_WATCH)
        ]
        self.assertEqual(
            self.parser.return_value.add_argument.mock_calls, expected_calls
        )
Esempio n. 4
0
    def test_parse_nginx_config_reloader_arguments_returns_parsed_arguments(
            self):
        ret = parse_nginx_config_reloader_arguments()

        self.assertEqual(ret, self.parser.return_value.parse_args.return_value)
Esempio n. 5
0
    def test_parse_nginx_config_reloader_arguments_instantiates_argparser(
            self):
        parse_nginx_config_reloader_arguments()

        self.parser.assert_called_once_with()
    def test_parse_nginx_config_reloader_arguments_returns_parsed_arguments(self):
        ret = parse_nginx_config_reloader_arguments()

        self.assertEqual(ret, self.parser.return_value.parse_args.return_value)
    def test_parse_nginx_config_reloader_arguments_instantiates_argparser(self):
        parse_nginx_config_reloader_arguments()

        self.parser.assert_called_once_with()