forked from libAtoms/abcd
-
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.
- Loading branch information
1 parent
bd94a25
commit c21f5b3
Showing
3 changed files
with
46 additions
and
0 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
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,41 @@ | ||
import os | ||
import unittest | ||
import logging | ||
from time import sleep | ||
|
||
|
||
class CLI(unittest.TestCase): | ||
""" | ||
Testing OpenSearch database CLI integration. | ||
""" | ||
|
||
@classmethod | ||
def setUpClass(cls): | ||
""" | ||
Set up OpenSearch database connection and login with CLI. | ||
""" | ||
if os.getenv("GITHUB_ACTIONS") != "true": | ||
raise unittest.SkipTest("Only runs via GitHub Actions") | ||
cls.security_enabled = os.getenv("security_enabled") == "true" | ||
cls.port = int(os.environ["port"]) | ||
cls.host = "localhost" | ||
|
||
logging.basicConfig(level=logging.INFO) | ||
|
||
url = f"opensearch://admin:admin@{cls.host}:{cls.port}" | ||
if not cls.security_enabled: | ||
url += " --disable_ssl" | ||
try: | ||
os.system(f"abcd login {url}") | ||
except (ConnectionError, ConnectionResetError): | ||
sleep(10) | ||
os.system(f"abcd login {url}") | ||
|
||
def test_summary(self): | ||
""" | ||
Test summary output of stored data. | ||
""" | ||
class_path = os.path.normpath(os.path.abspath(__file__)) | ||
data_file = os.path.dirname(class_path) + "/data/example.xyz" | ||
os.system(f"abcd upload {data_file}") | ||
os.system("abcd summary") |
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,4 @@ | ||
2 | ||
Properties=species:S:1:pos:R:3 s="sadf" _vtk_test="t _ e s t" pbc="F F F" | ||
Si 0.00000000 1.00000000 2.00000000 | ||
Si 4.00000000 5.00000000 6.00000000 |