-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move utils unit tests to separate file
- Loading branch information
Showing
2 changed files
with
31 additions
and
16 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 |
---|---|---|
|
@@ -22,7 +22,6 @@ | |
import pandas as pd | ||
import pytest | ||
import v3io | ||
from fsspec.implementations.local import LocalFileSystem | ||
|
||
from integration.integration_test_utils import V3ioHeaders, _generate_table_name | ||
from storey import ( | ||
|
@@ -39,7 +38,6 @@ | |
build_flow, | ||
) | ||
from storey.dtypes import V3ioError | ||
from storey.utils import get_remaining_path, url_to_file_system | ||
|
||
|
||
@pytest.fixture() | ||
|
@@ -666,17 +664,3 @@ def test_filter_before_after_partitioned_outer_other_partition(setup_teardown_te | |
] | ||
|
||
assert read_back_result == expected, f"{read_back_result}\n!=\n{expected}" | ||
|
||
|
||
def test_get_path_utils(): | ||
url = "wasbs://[email protected]/path/to/object.csv" | ||
schema, path = get_remaining_path(url) | ||
assert path == "mycontainer/path/to/object.csv" | ||
assert schema == "wasbs" | ||
|
||
|
||
def test_ds_get_path_utils(): | ||
url = "ds://:file@profile/path/to/object.csv" | ||
fs, path = url_to_file_system(url, "") | ||
assert path == "/path/to/object.csv" | ||
assert isinstance(fs, LocalFileSystem) |
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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Copyright 2023 Iguazio | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
from fsspec.implementations.local import LocalFileSystem | ||
|
||
from storey.utils import get_remaining_path, url_to_file_system | ||
|
||
|
||
def test_get_path_utils(): | ||
url = "wasbs://[email protected]/path/to/object.csv" | ||
schema, path = get_remaining_path(url) | ||
assert path == "mycontainer/path/to/object.csv" | ||
assert schema == "wasbs" | ||
|
||
|
||
def test_ds_get_path_utils(): | ||
url = "ds://:file@profile/path/to/object.csv" | ||
fs, path = url_to_file_system(url, "") | ||
assert path == "/path/to/object.csv" | ||
assert isinstance(fs, LocalFileSystem) |