forked from zerothi/sisl
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Nick Papior <[email protected]>
- Loading branch information
Showing
4 changed files
with
44 additions
and
40 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
ignore: | ||
- "benchmarks" | ||
- "data" | ||
- **/tests | ||
- benchmarks | ||
- data | ||
- **/tests/test_*.py | ||
|
||
coverage: | ||
notify: | ||
|
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,25 @@ | ||
from __future__ import print_function, division | ||
|
||
import pytest | ||
|
||
from sisl.unit import unit_group, unit_convert, unit_default | ||
|
||
pytestmark = pytest.mark.unit | ||
|
||
|
||
def test_group(): | ||
assert unit_group('kg') == 'mass' | ||
assert unit_group('eV') == 'energy' | ||
assert unit_group('N') == 'force' | ||
|
||
|
||
def test_unit_convert(): | ||
assert pytest.approx(unit_convert('kg', 'g')) == 1.e3 | ||
assert pytest.approx(unit_convert('eV', 'J')) == 1.60217733e-19 | ||
assert pytest.approx(unit_convert('J', 'eV')) == 1/1.60217733e-19 | ||
|
||
|
||
def test_default(): | ||
assert unit_default('mass') == 'amu' | ||
assert unit_default('energy') == 'eV' | ||
assert unit_default('force') == 'eV/Ang' |
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 was deleted.
Oops, something went wrong.