Exemplo n.º 1
0
def test_main_unpopulate(mocker):
    mocker.patch.object(demisto, 'args', side_effect=get_args_with_unpopulate)
    mocker.patch('CommonServerPython.IndicatorsSearcher.__next__',
                 side_effect=search_indicators_side_effect)
    entry = main()
    indicators = entry['Contents']
    assert len(indicators) == 2
    assert 'testField' not in indicators[0].keys()
    assert 'indicator_type' not in indicators[0].keys()
def test_main_populate(mocker):
    mocker.patch.object(demisto, 'args', side_effect=get_args_with_populate)
    mocker.patch.object(demisto,
                        'searchIndicators',
                        side_effect=search_indicators)

    entry = main()
    indicators = entry['Contents']
    assert len(indicators) == 2
    assert set(indicators[0].keys()) == set(['indicator_type', 'testField'])
Exemplo n.º 3
0
def test_main_with_hashing(mocker):
    mocker.patch.object(demisto, 'args', side_effect=get_args_with_hashing)
    mocker.patch('CommonServerPython.IndicatorsSearcher.__next__',
                 side_effect=search_indicators_side_effect)

    entry = main()
    indicators = entry['Contents']
    assert len(indicators) == 2
    assert indicators[0]['indicator_type'] == 'Email'
    assert indicators[0]['test2Fields'] == '19a5feec8b080d4865be5c7f69c320db'
Exemplo n.º 4
0
def test_main(mocker):
    mocker.patch.object(demisto, 'args', side_effect=get_args)
    mocker.patch('CommonServerPython.IndicatorsSearcher.__next__',
                 side_effect=search_indicators_side_effect)

    entry = main()
    indicators = entry['Contents']
    assert len(indicators) == 2
    assert indicators[0]['indicator_type'] == 'Email'
    assert indicators[0]['test2Fields'] == 'testValue2'
def test_main(mocker):
    mocker.patch.object(demisto, 'args', side_effect=get_args)
    mocker.patch.object(demisto,
                        'searchIndicators',
                        side_effect=search_indicators)

    entry = main()
    indicators = entry['Contents']
    assert len(indicators) == 2
    assert indicators[0]['indicator_type'] == 'Email'
    assert indicators[0]['test2Fields'] == 'testValue2'