예제 #1
0
    def setUp(self):
        self.arg_parser = init_arg_parser()
        self.xml_file = path.join(path.dirname(__file__), 'test.xml')
        self.log_file = path.join(path.dirname(__file__), 'test.log')

        open(self.xml_file, 'a').close()
        open(self.log_file, 'a').close()
예제 #2
0
    def setUp(self):
        self.arg_parser = init_arg_parser()
        self.xml_file = path.join(path.dirname(__file__), 'test.xml')
        self.log_file = path.join(path.dirname(__file__), 'test.log')

        open(self.xml_file, 'a').close()
        open(self.log_file, 'a').close()
예제 #3
0
def test_default_usage():
    parsed_arguments = init_arg_parser().parse_args(
        ['xmlfilepath', 'logfilepath'])
    assert_equals(parsed_arguments.xml_file_path, 'xmlfilepath')
    assert_equals(parsed_arguments.log_file_path, 'logfilepath')
    assert_equals(parsed_arguments.skipkvp, False)
    assert_equals(parsed_arguments.loglevel, 2)
    assert_equals(parsed_arguments.perf, False)
    assert_equals(
        parsed_arguments.config,
        path.join(path.split(path.dirname(__file__))[0], 'config\\db.config'))
예제 #4
0
def test_full_arguments_list():
    parsed_arguments = init_arg_parser().parse_args(
        ['xmlfilepath', 'logfilepath', '-k', '-c', 'config', '-l', '3',
         '-p', 'perflogpath']
    )

    assert_equals(parsed_arguments.xml_file_path, 'xmlfilepath')
    assert_equals(parsed_arguments.log_file_path, 'logfilepath')
    assert_equals(parsed_arguments.skipkvp, True)
    assert_equals(parsed_arguments.loglevel, 3)
    assert_equals(parsed_arguments.config, 'config')
    assert_equals(parsed_arguments.perf, 'perflogpath')
예제 #5
0
def test_full_name_arguments_list():
    parsed_arguments = init_arg_parser().parse_args([
        'xmlfilepath', 'logfilepath', '--skipkvp', '--config', 'config',
        '--loglevel', '3', '--perf', 'perflogpath'
    ])

    assert_equals(parsed_arguments.xml_file_path, 'xmlfilepath')
    assert_equals(parsed_arguments.log_file_path, 'logfilepath')
    assert_equals(parsed_arguments.skipkvp, True)
    assert_equals(parsed_arguments.loglevel, 3)
    assert_equals(parsed_arguments.config, 'config')
    assert_equals(parsed_arguments.perf, 'perflogpath')
def test_full_arguments_list():
    parsed_arguments = init_arg_parser().parse_args([
        'xmlfilepath', 'logfilepath', '-k', '-c', 'config', '-l', '3', '-p',
        'perflogpath', '-s', 'snapshot'
    ])

    assert_equals(parsed_arguments.xml_file_path, 'xmlfilepath')
    assert_equals(parsed_arguments.log_file_path, 'logfilepath')
    assert_equals(parsed_arguments.skipkvp, True)
    assert_equals(parsed_arguments.loglevel, 3)
    assert_equals(parsed_arguments.config, 'config')
    assert_equals(parsed_arguments.perf, 'perflogpath')
    assert_equals(parsed_arguments.snapshot, 'snapshot')
예제 #7
0
def test_full_name_arguments_list():
    parsed_arguments = init_arg_parser().parse_args(
        ['xmlfilepath', 'logfilepath', '--skipkvp',
         '--config', 'config', '--loglevel', '3',
         '--perf', 'perflogpath', '--snapshot', 'snapshot']
    )

    assert_equals(parsed_arguments.xml_file_path, 'xmlfilepath')
    assert_equals(parsed_arguments.log_file_path, 'logfilepath')
    assert_equals(parsed_arguments.skipkvp, True)
    assert_equals(parsed_arguments.loglevel, 3)
    assert_equals(parsed_arguments.config, 'config')
    assert_equals(parsed_arguments.perf, 'perflogpath')
    assert_equals(parsed_arguments.snapshot, 'snapshot')
예제 #8
0
def test_default_usage():
    parsed_arguments = init_arg_parser().parse_args(
        ['xmlfilepath', 'logfilepath']
    )
    assert_equals(parsed_arguments.xml_file_path, 'xmlfilepath')
    assert_equals(parsed_arguments.log_file_path, 'logfilepath')
    assert_equals(parsed_arguments.skipkvp, False)
    assert_equals(parsed_arguments.loglevel, 2)
    assert_equals(parsed_arguments.perf, False)
    assert_equals(
        parsed_arguments.config,
        path.join(
            path.split(path.dirname(__file__))[0],
            'config\\db.config'
        )
    )