示例#1
0
def test_gatherer_peer():
    a = Peer()

    def _resolve(i):
        return data

    a._resolve_ns = _resolve
    x = a.process(Indicator(indicator='216.90.108.0'))

    pprint(x)

    assert x.peers[0]['asn'] == '174'
def test_gatherer_peer():
    a = Peer()

    def _resolve(i):
        return data

    a._resolve_ns = _resolve
    x = a.process(Indicator(indicator="216.90.108.0"))

    pprint(x)

    assert x.peers[0]["asn"] == "23352"
def test_gatherer_peer():
    a = Peer()

    def _resolve(i):
        return data

    a._resolve_ns = _resolve
    x = a.process(Indicator(indicator='216.90.108.0'))

    if x.peers:
        assert 65535 > int(x.peers[0]['asn']) > 1
    else:
        warnings.warn('TC Not Responding...', UserWarning)
def test_gatherer_peer():
    a = Peer()

    def _resolve(i):
        return data

    a._resolve_ns = _resolve
    x = a.process(Indicator(indicator='216.90.108.0'))

    if x.peers:
        assert 65535 > int(x.peers[0]['asn']) > 1
    else:
        warnings.warn('TC Not Responding...', UserWarning)
def test_gatherer_peers():
    p = Peer()

    def _resolve(i):
        return data

    p._resolve_ns = _resolve
    x = p.process(Indicator(indicator='216.90.108.0'))

    mypeers = set()
    for pp in x.peers:
        mypeers.add(pp['asn'])

    assert '23352' in mypeers