Skip to content

Commit 74c86e6

Browse files
authored
Update compare yaml test case (#196)
Signed-off-by: jiyeong.seok <[email protected]>
1 parent 851ed0a commit 74c86e6

File tree

4 files changed

+8
-91
lines changed

4 files changed

+8
-91
lines changed

src/fosslight_util/compare_yaml.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,17 @@
44
# SPDX-License-Identifier: Apache-2.0
55

66
import logging
7+
from typing import List, Dict
78
from fosslight_util.constant import LOGGER_NAME
9+
from fosslight_util.oss_item import FileItem
810

911
logger = logging.getLogger(LOGGER_NAME)
1012
VERSION = 'version'
1113
LICENSE = 'license'
1214
NAME = 'name'
1315

1416

15-
def compare_yaml(before_fileitems, after_fileitems):
17+
def compare_yaml(before_fileitems: List[FileItem], after_fileitems: List[FileItem]) -> Dict[str, List]:
1618
bf_raw = []
1719
af_raw = []
1820
for bf in before_fileitems:

src/fosslight_util/convert_excel_to_yaml.py

Lines changed: 0 additions & 69 deletions
This file was deleted.

tests/legacy/test_compare_yaml.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,15 @@
55
import os
66
import json
77
from fosslight_util.compare_yaml import compare_yaml
8+
from fosslight_util.parsing_yaml import parsing_yml
89

910

1011
def main():
1112
cur = os.getcwd()
12-
result = compare_yaml(os.path.join(cur, 'before.yaml'), os.path.join(cur, 'after.yaml'))
13+
resources = os.path.join(cur, 'resources')
14+
before_fileitems, _, _ = parsing_yml(os.path.join(resources, 'before.yaml'), resources)
15+
after_fileitems, _, _ = parsing_yml(os.path.join(resources, 'after.yaml'), resources)
16+
result = compare_yaml(before_fileitems, after_fileitems)
1317
print(json.dumps(result, indent=4, sort_keys=True))
1418

1519

tests/legacy/test_convert_to_yaml.py

Lines changed: 0 additions & 20 deletions
This file was deleted.

0 commit comments

Comments
 (0)