-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: use common to_camel_case function (#171)
- Loading branch information
Showing
10 changed files
with
57 additions
and
58 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
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
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
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
3 changes: 0 additions & 3 deletions
3
src/ecalc/libraries/libecalc/common/libecalc/dto/utils/camelcase.py
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
src/ecalc/libraries/libecalc/common/libecalc/input/mappers/create_references.py
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
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
38 changes: 38 additions & 0 deletions
38
src/ecalc/libraries/libecalc/common/tests/common/test_string_utils.py
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,38 @@ | ||
import pytest | ||
from libecalc.common.string_utils import generate_id, get_duplicates, to_camel_case | ||
|
||
|
||
class TestGetDuplicates: | ||
def test_no_duplicates(self): | ||
assert get_duplicates(["name1", "name2", "name3"]) == set() | ||
|
||
def test_duplicates(self): | ||
assert get_duplicates(["name1", "name2", "name1"]) == {"name1"} | ||
|
||
|
||
class TestGenerateId: | ||
def test_single_string(self): | ||
assert isinstance(generate_id("some_name"), str) | ||
|
||
def test_multiple_strings(self): | ||
assert isinstance(generate_id("some_prefix", "some_type", "some_name"), str) | ||
|
||
|
||
test_data = [ | ||
# "snake_case, camel_case" | ||
("my_camel_case", "myCamelCase"), | ||
("m_c", "mC"), | ||
("m_C", "mC"), | ||
("M_C", "MC"), | ||
# ("_C", "C"), | ||
# ("_c", "C"), | ||
# ("m_", "m"), | ||
# ("M_", "M"), | ||
("my_cAmeLCase", "myCAmeLCase"), | ||
] | ||
|
||
|
||
class TestToCamelCase: | ||
@pytest.mark.parametrize("snake_case, camel_case", test_data) | ||
def test_to_camel_case(self, snake_case: str, camel_case: str): | ||
assert to_camel_case(snake_case) == camel_case |
20 changes: 0 additions & 20 deletions
20
src/ecalc/libraries/libecalc/common/tests/dto/utils/test_camelcase.py
This file was deleted.
Oops, something went wrong.
17 changes: 0 additions & 17 deletions
17
src/ecalc/libraries/libecalc/common/tests/dto/utils/test_string_utils.py
This file was deleted.
Oops, something went wrong.