summaryrefslogtreecommitdiffstats
path: root/tests/lib/helpers.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lib/helpers.py')
-rw-r--r--tests/lib/helpers.py40
1 files changed, 40 insertions, 0 deletions
diff --git a/tests/lib/helpers.py b/tests/lib/helpers.py
new file mode 100644
index 0000000..308f2a5
--- /dev/null
+++ b/tests/lib/helpers.py
@@ -0,0 +1,40 @@
+#!/usr/bin/python
+# coding: utf-8 -*-
+# pylint: disable=logger-format-interpolation
+# pylint: disable=dangerous-default-value
+# flake8: noqa: W503
+# flake8: noqa: W1202
+
+from __future__ import (absolute_import, division, print_function)
+
+import os
+
+from eos_downloader.data import DATA_MAPPING
+
+
+
+def default_filename(version: str, info):
+ """
+ default_filename Helper to build default filename
+
+ Parameters
+ ----------
+ version : str
+ EOS version
+ info : dict
+ TEST Inputs
+
+ Returns
+ -------
+ str
+ Filename
+ """
+ if version is None or info is None:
+ return None
+ return DATA_MAPPING[info['software']]['default']['prepend'] + '-' + version + '.swi'
+
+
+def is_on_github_actions():
+ """Check if code is running on a CI runner"""
+ if "CI" not in os.environ or not os.environ["CI"] or "GITHUB_RUN_ID" not in os.environ:
+ return False \ No newline at end of file