Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve A1.3 #4

Merged
merged 3 commits into from
Oct 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.1.3
2.2.3
Binary file modified app/__pycache__/constants.cpython-310.pyc
Binary file not shown.
Binary file modified app/models/__pycache__/instance.cpython-310.pyc
Binary file not shown.
Binary file modified app/services/__pycache__/a_indicators.cpython-310.pyc
Binary file not shown.
Binary file modified app/services/__pycache__/f_indicators.cpython-310.pyc
Binary file not shown.
Binary file modified app/services/__pycache__/i_indicators.cpython-310.pyc
Binary file not shown.
Binary file modified app/services/__pycache__/r_indicators.cpython-310.pyc
Binary file not shown.
17 changes: 15 additions & 2 deletions app/services/a_indicators.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,20 @@ def compA1_3(instance) -> Tuple[bool, str]:
logs.append('This is a web-based software. This indicator is not applicable.')
return False, logs

# 1. Check if there is a valid document similar to installation instructions

# 1. Check if @inst_instr is True
logs.append("⚙️ Checking if installation instructions are provided")
inst_instr = instance.inst_instr
logs.append(f"🔍 Received inst_instr: {inst_instr}")
if inst_instr is True:
logs.append("✅ Installation instructions are provided.")
logs.append("Result: PASSED")
return True, logs
else:
logs.append("❌ Installation instructions are not provided. Checking documentation ...")


# 2. Check if there is a valid document similar to installation instructions
# Check if the url is operational
logs.append("⚙️ Checking if there are installation instructions and whether they are operational")
documentation = instance.documentation
Expand All @@ -119,7 +132,7 @@ def compA1_3(instance) -> Tuple[bool, str]:
else:
logs.append("❌ No installation instructions found in documentation. Checking sources ...")

#2. Check if any of the sources provide installation instructions
# 3. Check if any of the sources provide installation instructions
logs.append("⚙️ Checking if any of the sources provide installation instructions")
source = instance.source
logs = log_sources(instance, logs)
Expand Down
Binary file modified app/tests/__pycache__/test_compA1_1.cpython-310-pytest-7.4.4.pyc
Binary file not shown.
Binary file modified app/tests/__pycache__/test_compA1_2.cpython-310-pytest-7.4.4.pyc
Binary file not shown.
Binary file modified app/tests/__pycache__/test_compA1_3.cpython-310-pytest-7.4.4.pyc
Binary file not shown.
Binary file modified app/tests/__pycache__/test_compA1_4.cpython-310-pytest-7.4.4.pyc
Binary file not shown.
Binary file modified app/tests/__pycache__/test_compA1_5.cpython-310-pytest-7.4.4.pyc
Binary file not shown.
Binary file modified app/tests/__pycache__/test_compF3_2.cpython-310-pytest-7.4.4.pyc
Binary file not shown.
Binary file modified app/tests/__pycache__/test_compI1_2.cpython-310-pytest-7.4.4.pyc
Binary file not shown.
Binary file modified app/tests/__pycache__/test_compR1_1.cpython-310-pytest-7.4.4.pyc
Binary file not shown.
Binary file modified app/tests/__pycache__/test_compR2_1.cpython-310-pytest-7.4.4.pyc
Binary file not shown.
Binary file modified app/tests/__pycache__/test_compR3_1.cpython-310-pytest-7.4.4.pyc
Binary file not shown.
Binary file modified app/tests/__pycache__/test_compR4_2.cpython-310-pytest-7.4.4.pyc
Binary file not shown.
27 changes: 25 additions & 2 deletions app/tests/test_compA1_3.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@
from app.models.instance import Instance, Documentation

# Define test instances using Pydantic models
def create_instance(type, download, source, documentation):
def create_instance(type, download, source, documentation, inst_instr=False):
return Instance(
type=type,
download=[HttpUrl(url) for url in download] if download else [],
source=source,
documentation=[Documentation(type=doc['type'], url=HttpUrl(doc['url'])) for doc in documentation] if documentation else []
documentation=[Documentation(type=doc['type'], url=HttpUrl(doc['url'])) for doc in documentation] if documentation else [],
inst_instr=inst_instr
)

def test_compA1_3_with_no_web_and_download():
Expand Down Expand Up @@ -85,6 +86,28 @@ def test_compA1_3_with_web_and_valid_source():
result, logs = compA1_3(instance)
assert result == False

def test_compA1_3_with_web_and_true_inst_intr():
instance = create_instance(
type='web',
download=[],
source=["bioconda"],
documentation=[],
inst_instr=True
)
result, logs = compA1_3(instance)
assert result == False

def test_compA1_3_with_cmd_and_true_inst_intr():
instance = create_instance(
type='cmd',
download=[],
source=["bioconda"],
documentation=[],
inst_instr=True
)
result, logs = compA1_3(instance)
assert result == True

def test_compA1_3_with_web_and_installation_instructions():
instance = create_instance(
type='web',
Expand Down
Loading