Skip to content
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
6 changes: 5 additions & 1 deletion .reuse/dep5
Original file line number Diff line number Diff line change
Expand Up @@ -120,4 +120,8 @@ License: Apache-2.0

Files: tests/test_cargo/*
Copyright: 2024 LG Electronics
License: Apache-2.0
License: Apache-2.0

Files: tests/test_mod/*
Copyright: 2024 junegunn(Junegunn Choi)
License: MIT
3 changes: 2 additions & 1 deletion tests/pytest/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
"tests/result/nuget2",
"tests/result/pub",
"tests/result/pypi",
"tests/result/cargo"
"tests/result/cargo",
"tests/result/mod"
]

remove_directories = set_up_directories
Expand Down
32 changes: 32 additions & 0 deletions tests/pytest/package_manager/test_mod.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2024 LG Electronics Inc.
# SPDX-License-Identifier: Apache-2.0
import os
import pytest
import subprocess


DIST_PATH = os.path.join(os.environ.get("TOX_PATH"), "dist", "cli.exe")


@pytest.mark.parametrize("input_path, output_path, extra_args", [
("tests/test_mod", "tests/result/mod", "-m mod")
])
@pytest.mark.ubuntu
def test_ubuntu(input_path, output_path, extra_args):
command = f"fosslight_dependency -p {input_path} -o {output_path} {extra_args}"
result = subprocess.run(command, shell=True, capture_output=True, text=True)
assert result.returncode == 0, f"Command failed: {command}\nstdout: {result.stdout}\nstderr: {result.stderr}"
assert any(os.scandir(output_path)), f"Output file does not exist: {output_path}"


@pytest.mark.parametrize("input_path, output_path", [
(os.path.join("tests", "test_mod"), os.path.join("tests", "result", "mod")),
])
@pytest.mark.windows
def test_windows(input_path, output_path):
command = f"{DIST_PATH} -p {input_path} -o {output_path}"
result = subprocess.run(command, capture_output=True, text=True)
assert result.returncode == 0, f"Command failed: {command}\nstdout: {result.stdout}\nstderr: {result.stderr}"
assert any(os.scandir(output_path)), f"Output file does not exist: {output_path}"
20 changes: 20 additions & 0 deletions tests/test_mod/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
module github.com/junegunn/fzf

require (
github.com/charlievieth/fastwalk v1.0.8
github.com/gdamore/tcell/v2 v2.7.4
github.com/junegunn/go-shellwords v0.0.0-20240813092932-a62c48c52e97
github.com/mattn/go-isatty v0.0.20
github.com/rivo/uniseg v0.4.7
golang.org/x/sys v0.26.0
golang.org/x/term v0.25.0
)

require (
github.com/gdamore/encoding v1.0.0 // indirect
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
github.com/mattn/go-runewidth v0.0.15 // indirect
golang.org/x/text v0.14.0 // indirect
)

go 1.20
Loading