Skip to content

Commit

Permalink
Fix all test paths
Browse files Browse the repository at this point in the history
  • Loading branch information
silvexis committed Aug 17, 2024
1 parent b7e757b commit b80822a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions tests/common/test_cli.py
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 support@cloudzero.com
import os
from pathlib import Path

from uca.common.cli import print_uca_sample
from uca.common.files import load_jsonl
Expand All @@ -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")
Expand Down
6 changes: 4 additions & 2 deletions tests/common/test_files.py
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 support@cloudzero.com
from pathlib import Path

from uca.common.files import load_data_files

Expand All @@ -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
5 changes: 2 additions & 3 deletions tests/features/test_generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Direct all questions to support@cloudzero.com

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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit b80822a

Please sign in to comment.