Skip to content

Commit

Permalink
fix(test): failures of test_eap_reports in some test env (#4310)
Browse files Browse the repository at this point in the history
- the timezone update in compliance tests breaks the eap_reports
  tests which are time sensitive

Signed-off-by: Xiangce Liu <[email protected]>
(cherry picked from commit 952f219)
  • Loading branch information
xiangce committed Jan 2, 2025
1 parent 380f79b commit a2e3110
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions insights/tests/datasources/compliance/test_compliance.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,25 @@

from insights.specs.datasources.compliance import ComplianceClient

ENV_TZ = None
PATH = '/usr/share/xml/scap/ref_id.xml'


def setup_function(func):
global ENV_TZ
ENV_TZ = os.environ.get("TZ")


def teardown_function(func):
global ENV_TZ
env = os.environ
if "TZ" in env:
if ENV_TZ is None:
env.pop("TZ")
else:
env.update(TZ=ENV_TZ)


@patch("insights.client.config.InsightsConfig", base_url='localhost/app', systemid='', proxy=None)
def test_get_system_policies(config):
compliance_client = ComplianceClient(config=config)
Expand Down

0 comments on commit a2e3110

Please sign in to comment.