-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #88 from molssi-seamm/dev
Added support for charge in chemical formulae
- Loading branch information
Showing
3 changed files
with
61 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
|
||
"""Tests for `bonds` in the `molsystem` package.""" | ||
|
||
import pytest # noqa: F401 | ||
|
||
|
||
def test_simple(AceticAcid): | ||
"""Simple test for acetic acid""" | ||
assert AceticAcid.formula == ("C2 H4 O2", "C H2 O", 2) | ||
|
||
|
||
def test_periodic(copper): | ||
"""Test for copper crystal""" | ||
assert copper.formula == ("Cu4", "Cu", 4) | ||
|
||
|
||
def test_charged(configuration): | ||
"""Test for charged configuration""" | ||
configuration.from_smiles("[NH4+]") | ||
assert configuration.formula == ("[H4 N]+", "[H4 N]+", 1) | ||
|
||
|
||
def test_doubly_charged(configuration): | ||
"""Test for charged configuration""" | ||
configuration.from_smiles("[NH4+].[NH4+]") | ||
assert configuration.formula == ("[H8 N2]+2", "[H4 N]+", 2) |