예제 #1
0
def test_detect_ignore_default():
    parser = get_command_line_parser(['valid-detector'], [])
    result = parser.parse_args(['detect', 'valid-detector', '1'])
    assert result.black_list == []
예제 #2
0
def test_detect_timeout():
    parser = get_command_line_parser(['valid-detector'], [])
    value = '100'
    result = parser.parse_args(['detect', 'valid-detector', '1', '--timeout', value])
    assert result.timeout == int(value)
예제 #3
0
def test_detect_ignore_empty_list_fails():
    parser = get_command_line_parser(['valid-detector'], [])
    assert_raises(SystemExit, parser.parse_args, ['detect', 'valid-detector', '--skip'])
예제 #4
0
def test_detect_ignore():
    parser = get_command_line_parser(['valid-detector'], [])
    black_list = ['a', 'b', 'c']
    result = parser.parse_args(['detect', 'valid-detector', '1', '--skip'] + black_list)
    assert result.black_list == black_list
예제 #5
0
def test_java_options_default_empty():
    parser = get_command_line_parser(['valid-detector'], [])
    result = parser.parse_args(['detect', 'valid-detector', '1'])
    assert_equals([], result.java_options)
예제 #6
0
def test_detect_only_default():
    parser = get_command_line_parser(['valid-detector'], [])
    result = parser.parse_args(['detect', 'valid-detector', '1'])
    assert result.white_list == []
예제 #7
0
def test_detect_valid():
    parser = get_command_line_parser(['valid-detector'], [])
    result = parser.parse_args(['detect', 'valid-detector', '1'])
    assert result.detector == 'valid-detector'
예제 #8
0
def test_timeout_non_int_fails():
    parser = get_command_line_parser(['valid-detector'], [])
    assert_raises(SystemExit, parser.parse_args, ['detect', 'valid-detector', '1', '--timeout', 'string'])
예제 #9
0
def test_detect_fails_without_detector():
    parser = get_command_line_parser([], [])
    assert_raises(SystemExit, parser.parse_args, ['detect'])
예제 #10
0
def test_detect_fails_without_experiment():
    parser = get_command_line_parser(['valid-detector'], [])
    assert_raises(SystemExit, parser.parse_args, ['detect', 'valid-detector'])
예제 #11
0
def test_checkout():
    parser = get_command_line_parser([], [])
    result = parser.parse_args(['checkout'])
    assert result.task == 'checkout'
예제 #12
0
def test_dataset():
    parser = get_command_line_parser(['Dummy'], [])
    result = parser.parse_args(['detect', 'Dummy', '1', '--dataset', 'crypto'])
    assert_equals('crypto', result.dataset)
예제 #13
0
def test_script_is_case_insensitive():
    parser = get_command_line_parser([], ['GENERAL'])
    parser.parse_args(['stats', 'general'])
예제 #14
0
def test_detect_experiment_is_int():
    parser = get_command_line_parser(['valid-detector'], [])
    result = parser.parse_args(['detect', 'valid-detector', '1'])
    assert_equals(int, type(result.experiment))
예제 #15
0
def test_detect_only():
    parser = get_command_line_parser(['valid-detector'], [])
    white_list = ['a', 'b', 'c']
    result = parser.parse_args(['detect', 'valid-detector', '1', '--only'] + white_list)
    assert result.white_list == white_list
예제 #16
0
def test_timeout_default_none():
    parser = get_command_line_parser(['valid-detector'], [])
    result = parser.parse_args(['detect', 'valid-detector', '1'])
    assert result.timeout is None
예제 #17
0
def test_invalid_mode():
    parser = get_command_line_parser([], [])
    assert_raises(SystemExit, parser.parse_args, ['invalid'])
예제 #18
0
def test_detect_fails_for_invalid_detector():
    parser = get_command_line_parser(['valid-detector'], [])
    assert_raises(SystemExit, parser.parse_args, ['detect', 'invalid-detector'])
예제 #19
0
def test_java_options():
    parser = get_command_line_parser(['valid-detector'], [])
    result = parser.parse_args(['detect', 'valid-detector', '1', '--java-options', 'Xmx6144M', 'd64'])
    assert_equals(['Xmx6144M', 'd64'], result.java_options)