forked from diffpy/diffpy.structure
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_utils.py
More file actions
37 lines (32 loc) · 1.02 KB
/
test_utils.py
File metadata and controls
37 lines (32 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/env python
##############################################################################
#
# diffpy.structure Complex Modeling Initiative
# (c) 2016 Brookhaven Science Associates,
# Brookhaven National Laboratory.
# All rights reserved.
#
# File coded by: Pavol Juhas
#
# See AUTHORS.txt for a list of people who contributed.
# See LICENSE.txt for license information.
#
##############################################################################
"""Test for Structure utilities."""
import pytest
from diffpy.structure.utils import atom_bare_symbol, atomBareSymbol
def test_atomBareSymbol():
assert atomBareSymbol("Cl-") == "Cl"
assert atomBareSymbol("Ca2+") == "Ca"
assert atomBareSymbol("12-C") == "C"
@pytest.mark.parametrize(
"symbol, expected",
[
("Cl-", "Cl"),
("Ca2+", "Ca"),
("12-C", "C"),
],
)
def test_atom_bare_symbol(symbol, expected):
actual = atom_bare_symbol(symbol)
assert actual == expected