Skip to content

Commit c3df600

Browse files
committed
more tests
1 parent 51cac38 commit c3df600

File tree

4 files changed

+28
-1
lines changed

4 files changed

+28
-1
lines changed

pyNastran/bdf/cards/test/test_bolt_nx.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def test_bolt_msc_1(self):
1515
nids_top=nids_top,
1616
nids_btm=nids_btm,
1717
comment='bolt_msc')
18-
bolt.cross_reference()
18+
bolt.cross_reference(model)
1919
model.cross_reference()
2020
str(bolt)
2121
bolt.raw_fields()

pyNastran/bdf/mesh_utils/test/test_run_host_jobs.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,30 @@
44
import pyNastran
55
from pyNastran.bdf.mesh_utils.run_jobs import get_bdf_filenames_to_run, cmd_line_run_jobs
66
from pyNastran.bdf.mesh_utils.host_jobs import cmd_line_host_jobs
7+
from pyNastran.utils.nastran_utils import _get_keywords_list
8+
79
PKG_PATH = Path(pyNastran.__path__[0])
810
MODEL_PATH = PKG_PATH / '..' / 'models'
911

1012

1113
class TestRunHostJobs(unittest.TestCase):
14+
def test_keyworks(self):
15+
keywords_strs = [
16+
'scr=yes', 'old=no', 'news=no', 'mem=16gb',
17+
'parallel=8', 'auth=123@host', 'endian=little',
18+
'bat=no', 'fake=cat',
19+
]
20+
for keywords_str in keywords_strs:
21+
keywords_list = _get_keywords_list(keywords_str)
22+
keywords_list = _get_keywords_list(keywords_strs)
23+
24+
keyword_dict = {
25+
'scr': 'yes',
26+
'old': 'no',
27+
'news': "no",
28+
}
29+
keywords_list = _get_keywords_list(keyword_dict)
30+
1231
def test_host_jobs(self):
1332
str_model_path = str(MODEL_PATH)
1433
args = ['bdf', 'host_jobs', str_model_path, '--test', '--nmax', '2']

pyNastran/utils/nastran_utils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ def _get_keywords_list(keywords: Optional[str | list[str] |
142142
continue
143143
keywords_list.append(f'{keyword}={value}')
144144

145+
#print(f'keywords_list = {keywords_list}')
145146
allowed_keywords = list(KEYWORDS_CHECK) + [
146147
'parallel', 'mem', 'sdirectory', 'sdir',
147148
'buffsize'] # CHEMIN={path}

pyNastran/utils/test/test_atmosphere.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,13 @@ def test_pressure(self):
145145
with self.assertRaises(RuntimeError):
146146
convert_pressure(1., 'bad', 'psf')
147147

148+
assert np.allclose(convert_pressure(1., 'bar', 'Pa'), 100_000.)
149+
assert np.allclose(convert_pressure(1., 'Pa', 'bar'), 1 / 100_000.)
150+
151+
assert np.allclose(convert_pressure(1., 'bar', 'kPa'), 100.)
152+
assert np.allclose(convert_pressure(1., 'kPa', 'bar'), 1 / 100.)
153+
154+
#------------
148155
assert np.allclose(convert_pressure(1., 'psf', 'Pa'), 47.880208)
149156
assert np.allclose(convert_pressure(1., 'Pa', 'psf'), 1 / 47.880208)
150157

0 commit comments

Comments
 (0)