-
Notifications
You must be signed in to change notification settings - Fork 142
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FEAT: Import materials from Workbench (#5186)
Co-authored-by: samuel <[email protected]>
- Loading branch information
1 parent
2874d68
commit 949d676
Showing
17 changed files
with
6,207 additions
and
36 deletions.
There are no files selected for viewing
1,452 changes: 1,452 additions & 0 deletions
1,452
_unittest/example_models/T03/EngineeringData1.xml
Large diffs are not rendered by default.
Oops, something went wrong.
2,660 changes: 2,660 additions & 0 deletions
2,660
_unittest/example_models/T03/EngineeringData2.xml
Large diffs are not rendered by default.
Oops, something went wrong.
1,491 changes: 1,491 additions & 0 deletions
1,491
_unittest/example_models/T03/EngineeringData3.xml
Large diffs are not rendered by default.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# -*- coding: utf-8 -*- | ||
# | ||
# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates. | ||
# SPDX-License-Identifier: MIT | ||
# | ||
# | ||
# Permission is hereby granted, free of charge, to any person obtaining a copy | ||
# of this software and associated documentation files (the "Software"), to deal | ||
# in the Software without restriction, including without limitation the rights | ||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
# copies of the Software, and to permit persons to whom the Software is | ||
# furnished to do so, subject to the following conditions: | ||
# | ||
# The above copyright notice and this permission notice shall be included in all | ||
# copies or substantial portions of the Software. | ||
# | ||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
# SOFTWARE. | ||
|
||
from ansys.aedt.core.generic import data_handlers as dh | ||
import pytest | ||
|
||
|
||
@pytest.fixture(scope="module", autouse=True) | ||
def desktop(): | ||
"""Override the desktop fixture to DO NOT open the Desktop when running this test class""" | ||
return | ||
|
||
|
||
class TestClass: | ||
|
||
def test_str_to_bool(self): | ||
test_list_1 = ["one", "two", "five"] | ||
bool_values = list(map(dh.str_to_bool, test_list_1)) | ||
assert all(isinstance(b, str) for b in bool_values) # All strings | ||
test_list_1.append("True") | ||
assert True in list(map(dh.str_to_bool, test_list_1)) | ||
test_list_2 = ["Stop", "go", "run", "crawl", "False"] | ||
assert False in list(map(dh.str_to_bool, test_list_2)) | ||
|
||
def test_normalize_string_format(self): | ||
dirty = "-Hello Wòrld - Test---Strïng - With - Múltiple Spaces ç & Unsupport€d Ch@rachter$ £ike * " # codespell:ignore # noqa: E501 | ||
clean = "Hello_World_Test_String_With_Multiple_Spaces_c_and_UnsupportEd_ChatrachterS_Like" # codespell:ignore # noqa: E501 | ||
assert dh.normalize_string_format(dirty) == clean |
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
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
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
Oops, something went wrong.