Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
ocervell committed Apr 23, 2024
1 parent c7eeba9 commit e294cba
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions secator/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import requests
import yaml
from dotmap import DotMap
from pydantic import AfterValidator, BaseModel, model_validator, ValidationError, Extra
from pydantic import AfterValidator, BaseModel, model_validator, ValidationError

from secator.rich import console, console_stdout

Expand All @@ -19,7 +19,7 @@
CONFIGS_FOLDER = LIB_FOLDER / 'configs'


class StrictModel(BaseModel, extra=Extra.forbid):
class StrictModel(BaseModel, extra='forbid'):
pass


Expand Down
8 changes: 8 additions & 0 deletions tests/unit/test_offline.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
import os
import sys
import unittest


class TestOffline(unittest.TestCase):
def setUp(self):
try:
# This allows to drop the secator module loaded from other tests in order to reload the config with modified
# environment variables.
# See https://stackoverflow.com/questions/7460363/re-import-module-under-test-to-lose-context for context.
del sys.modules['secator']
except KeyError:
pass
os.environ['SECATOR_OFFLINE_MODE'] = '1'

def test_offline_cve_lookup(self):
Expand Down

0 comments on commit e294cba

Please sign in to comment.