Skip to content

Commit

Permalink
Update test method naming
Browse files Browse the repository at this point in the history
  • Loading branch information
Chrylo committed Jun 18, 2024
1 parent e7cd04d commit 70a8bc3
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
2 changes: 2 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
- [`velocitas_lib.get_script_path`](./velocitas_lib.md#function-get_script_path): Return the absolute path to the directory the invoked Python script
- [`velocitas_lib.get_valid_arch`](./velocitas_lib.md#function-get_valid_arch): Return a known architecture for the given `arch`.
- [`velocitas_lib.get_workspace_dir`](./velocitas_lib.md#function-get_workspace_dir): Return the workspace directory.
- [`velocitas_lib.is_uri`](./velocitas_lib.md#function-is_uri): Check if the provided path is a URI.
- [`velocitas_lib.obtain_local_file_path`](./velocitas_lib.md#function-obtain_local_file_path): Return the absolute path to the file, specified by a absolute/relative local path or with an URI.
- [`velocitas_lib.require_env`](./velocitas_lib.md#function-require_env): Require and return an environment variable.
- [`conan_utils.add_dependency_to_conanfile`](./velocitas_lib.conan_utils.md#function-add_dependency_to_conanfile): Add the dependency name to the project's list of dependencies.
- [`conan_utils.export_conan_project`](./velocitas_lib.conan_utils.md#function-export_conan_project): Export a conan project to the local conan cache.
Expand Down
4 changes: 2 additions & 2 deletions docs/velocitas_lib.md
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ download_file(uri: str, local_file_path: str) → None

---

<a href="../velocitas_lib/__init__.py#L227"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../velocitas_lib/__init__.py#L146"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

## <kbd>function</kbd> `is_uri`

Expand All @@ -257,7 +257,7 @@ Check if the provided path is a URI.

---

<a href="../velocitas_lib/__init__.py#L239"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../velocitas_lib/__init__.py#L158"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

## <kbd>function</kbd> `obtain_local_file_path`

Expand Down
18 changes: 9 additions & 9 deletions tests/test_text_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def Move(self, request, context):
test_text: list[str] = [str(line) for line in test_text_literal]


def test_item_in_list():
def test_item_in_list__replaces_all_occurrences_of_item_with_replacement():
replaced_text = replace_item_in_list(
test_text,
"Seats",
Expand All @@ -55,9 +55,9 @@ def test_item_in_list():
matching_count = replaced_text.count("ReplacedTestString")

assert matching_count == 2
def test_item_in_list_removes_empty_lines():


def test_item_in_list__remove_empty_enabled__removes_empty_lines_if_replacement_empty():
replaced_text = replace_item_in_list(
test_text,
"'''",
Expand All @@ -67,7 +67,7 @@ def test_item_in_list_removes_empty_lines():
assert len(replaced_text) == 20


def test_item_in_list_keep_empty_lines():
def test_item_in_list__remove_empty_disabled__keeps_empty_lines():
replaced_text = replace_item_in_list(
test_text,
"'''",
Expand All @@ -76,7 +76,7 @@ def test_item_in_list_keep_empty_lines():
assert len(replaced_text) == 24


def test_replace_text_area():
def test_replace_text_area__replaces_all_text_in_area_with_replacement():
replaced_text = replace_text_area(
test_text,
"# <auto-generated>",
Expand All @@ -88,11 +88,11 @@ def test_replace_text_area():
assert matching_count == 1


def test_replace_text_area_remove_lines():
def test_replace_text_area__no_replacement_given__removes_lines():
replaced_text = replace_text_area(
test_text,
"'''",
"'''",
)
assert len(replaced_text) == 10

assert len(replaced_text) == 10

0 comments on commit 70a8bc3

Please sign in to comment.