Skip to content

Commit

Permalink
fix: PEP8 formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
franjuan committed Oct 4, 2024
1 parent bee754f commit a75cfc1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions tests/integration/test_api_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
import types
from datetime import datetime, timedelta
import zoneinfo
UTC = zoneinfo.ZoneInfo("UTC")

from ssl import CERT_NONE
import pytest
from ip_validation import is_valid_ip
Expand All @@ -16,6 +14,8 @@
from devo.common.loadenv.load_env import load_env_file
from devo.sender.data import Sender, SenderConfigSSL

UTC = zoneinfo.ZoneInfo("UTC")

# Load environment variables form test directory
load_env_file(os.path.abspath(os.getcwd()) + os.sep + "environment.env")

Expand Down
12 changes: 6 additions & 6 deletions tests/integration/test_api_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,23 +30,23 @@ def setup_client(job_name):
def setup_query():
yield "from siem.logtrust.web.connection select action"


@pytest.fixture(scope="module")
def job_name():
return "devo-sdk-api-test" + str(uuid.uuid1().int)


#@pytest.mark.skip("temporarily disabled due to Query API bug")
def test_jobs_cycle(setup_client, setup_query, job_name):
result = setup_client.query(query=setup_query, dates={"from": "1d", "to": "endday"})
result = json.loads(result)
assert result["status"]==0
assert result["status"] == 0
assert "object" in result
assert "id" in result["object"]
job_id=result["object"]["id"]
job_id = result["object"]["id"]

# Get all jobs
result = setup_client.get_jobs()
assert len(result["object"])>0
assert len(result["object"]) > 0

# Get job by job id
result = setup_client.get_job(job_id=job_id)
Expand All @@ -55,11 +55,11 @@ def test_jobs_cycle(setup_client, setup_query, job_name):

# Stop job by id
result = setup_client.stop_job(job_id)
assert result["object"]["status"] in ["STOPPED","COMPLETED"]
assert result["object"]["status"] in ["STOPPED", "COMPLETED"]

# Start job by id
result = setup_client.start_job(job_id)
assert result["object"]["status"] in ["RUNNING","COMPLETED"]
assert result["object"]["status"] in ["RUNNING", "COMPLETED"]

# Delete all jobs created by this and past test execution (cleaning purposes)
result = setup_client.get_jobs()
Expand Down

0 comments on commit a75cfc1

Please sign in to comment.