mirror of
https://github.com/reconurge/flowsint.git
synced 2026-05-01 19:58:59 -05:00
feat: flowsint-transforms, flowsint-types, flowsint-core
This commit is contained in:
0
flowsint-transforms/tests/tools/network/__init__.py
Normal file
0
flowsint-transforms/tests/tools/network/__init__.py
Normal file
42
flowsint-transforms/tests/tools/network/asnmap.py
Normal file
42
flowsint-transforms/tests/tools/network/asnmap.py
Normal file
@@ -0,0 +1,42 @@
|
||||
import re
|
||||
from typing import Dict
|
||||
from app.tools.network.asnmap import AsnmapTool
|
||||
|
||||
tool = AsnmapTool()
|
||||
|
||||
def test_name():
|
||||
assert tool.name() == "asnmap"
|
||||
|
||||
def test_description():
|
||||
assert tool.description() == "ASN mapping and network reconnaissance tool."
|
||||
|
||||
def test_category():
|
||||
assert tool.category() == "ASN discovery"
|
||||
|
||||
def test_image():
|
||||
assert tool.get_image() == "projectdiscovery/asnmap"
|
||||
|
||||
def test_install():
|
||||
tool.install()
|
||||
assert tool.is_installed() == True
|
||||
|
||||
def test_version():
|
||||
tool.install()
|
||||
version = tool.version()
|
||||
# Check that version follows the expected format: v followed by digits and dots
|
||||
assert re.match(r'^v[\d\.]+$', version)
|
||||
|
||||
def test_launch_no_api_key():
|
||||
import pytest
|
||||
with pytest.raises(KeyError, match="Missing key"):
|
||||
tool.launch("alliage.io", 'domain')
|
||||
|
||||
def test_launch_wrong_type():
|
||||
import pytest
|
||||
with pytest.raises(ValueError, match="Invalid type: 'domains'"):
|
||||
tool.launch("alliage.io", 'domains')
|
||||
|
||||
def test_launch():
|
||||
results = tool.launch("alliage.io", 'domain')
|
||||
assert isinstance(results, Dict)
|
||||
|
||||
40
flowsint-transforms/tests/tools/network/httpx.py
Normal file
40
flowsint-transforms/tests/tools/network/httpx.py
Normal file
@@ -0,0 +1,40 @@
|
||||
import re
|
||||
from typing import List
|
||||
from app.tools.network.httpx import HttpxTool
|
||||
|
||||
tool = HttpxTool()
|
||||
|
||||
def test_name():
|
||||
assert tool.name() == "httpx"
|
||||
|
||||
def test_description():
|
||||
assert tool.description() == "An HTTP toolkit that probes services, web servers, and other valuable metadata."
|
||||
|
||||
def test_category():
|
||||
assert tool.category() == "Web technologies enumeration"
|
||||
|
||||
def test_image():
|
||||
assert tool.get_image() == "projectdiscovery/httpx"
|
||||
|
||||
def test_install():
|
||||
tool.install()
|
||||
assert tool.is_installed() == True
|
||||
|
||||
def test_version():
|
||||
tool.install()
|
||||
version = tool.version()
|
||||
# Check that version follows the expected format: v followed by digits and dots
|
||||
assert re.match(r'^v[\d\.]+$', version)
|
||||
|
||||
def test_launch():
|
||||
assert True
|
||||
results = tool.launch("https://alliage.io")
|
||||
print(results)
|
||||
assert isinstance(results, List)
|
||||
|
||||
def test_launch_unreached_host():
|
||||
assert True
|
||||
results = tool.launch("https://this-is-not-a-valid-domain.local")
|
||||
assert isinstance(results, List)
|
||||
assert len(results) == 0
|
||||
|
||||
20
flowsint-transforms/tests/tools/network/reconcrawl.py
Normal file
20
flowsint-transforms/tests/tools/network/reconcrawl.py
Normal file
@@ -0,0 +1,20 @@
|
||||
import re
|
||||
from typing import Dict
|
||||
from app.tools.network.reconcrawl import ReconCrawlTool
|
||||
|
||||
tool = ReconCrawlTool()
|
||||
|
||||
def test_name():
|
||||
assert tool.name() == "reconcrawl"
|
||||
|
||||
def test_description():
|
||||
assert tool.description() == "Emails and phone numbers crawler from websites by analyzing their HTML and embedded scripts."
|
||||
|
||||
def test_category():
|
||||
assert tool.category() == "Crawler"
|
||||
|
||||
def test_install():
|
||||
tool.install()
|
||||
assert tool.is_installed() == True
|
||||
|
||||
|
||||
32
flowsint-transforms/tests/tools/network/subfinder.py
Normal file
32
flowsint-transforms/tests/tools/network/subfinder.py
Normal file
@@ -0,0 +1,32 @@
|
||||
import re
|
||||
from app.tools.network.subfinder import SubfinderTool
|
||||
|
||||
tool = SubfinderTool()
|
||||
|
||||
def test_name():
|
||||
assert tool.name() == "subfinder"
|
||||
|
||||
def test_description():
|
||||
assert tool.description() == "Fast passive subdomain enumeration tool."
|
||||
|
||||
def test_category():
|
||||
assert tool.category() == "Subdomain enumeration"
|
||||
|
||||
def test_image():
|
||||
assert tool.get_image() == "projectdiscovery/subfinder"
|
||||
|
||||
def test_install():
|
||||
tool.install()
|
||||
assert tool.is_installed() == True
|
||||
|
||||
def test_version():
|
||||
tool.install()
|
||||
version = tool.version()
|
||||
# Check that version follows the expected format: v followed by digits and dots
|
||||
assert re.match(r'^v[\d\.]+$', version)
|
||||
|
||||
def test_launch():
|
||||
results = tool.launch("alliage.io")
|
||||
assert isinstance(results, list)
|
||||
assert all(isinstance(item, str) for item in results)
|
||||
|
||||
Reference in New Issue
Block a user