-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
8 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
# Copyright (c) 2021-2024 CloudZero, Inc. or its affiliates. All Rights Reserved. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# Direct all questions to [email protected] | ||
import os | ||
from pathlib import Path | ||
|
||
from uca.common.cli import print_uca_sample | ||
from uca.common.files import load_jsonl | ||
|
@@ -17,7 +17,7 @@ def test_print_uca_sample(): | |
""" | ||
# load sample uca data | ||
uca_sample_data_path = os.path.join(os.path.dirname(__file__), "../data/sample_uca_data.jsonl") | ||
uca_sample_data_path = str((Path(__file__).parent / "../data/sample_uca_data.jsonl").resolve()) | ||
uca_data = load_jsonl(uca_sample_data_path) | ||
|
||
print("Running test\n\n") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
# Copyright (c) 2024 CloudZero, Inc. or its affiliates. All Rights Reserved. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# Direct all questions to [email protected] | ||
from pathlib import Path | ||
|
||
from uca.common.files import load_data_files | ||
|
||
|
@@ -9,8 +10,9 @@ def test_load_data_files(): | |
""" | ||
Test to load data files | ||
""" | ||
data_files = load_data_files("../data/test_data.csv", "TEXT") | ||
test_data_file = str((Path(__file__).parent / "../data/test_data.csv").resolve()) | ||
data_files = load_data_files(test_data_file, "TEXT") | ||
assert len(data_files) == 13 | ||
|
||
data_files = load_data_files("../data/test_data.csv", "CSV") | ||
data_files = load_data_files(test_data_file, "CSV") | ||
assert len(data_files) == 12 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
# Direct all questions to [email protected] | ||
|
||
import datetime | ||
import os | ||
from pathlib import Path | ||
|
||
from uca.common.files import load_data_files | ||
from uca.features.generate import _render_uca_data, generate_uca | ||
|
@@ -66,8 +66,7 @@ def test_generate_uca_data_from_CSV(input_settings, input_template): | |
None | ||
""" | ||
test_data_file = os.path.join(os.path.dirname(__file__), "../data/test_data.csv") | ||
|
||
test_data_file = str((Path(__file__).parent / "../data/test_data.csv").resolve()) | ||
test_data = load_data_files(test_data_file, "CSV") | ||
uca_to_send = generate_uca(None, input_template, input_settings, test_data) | ||
assert len(uca_to_send) == 12 | ||
|