Skip to content

Commit dbf24c0

Browse files
committed
test that there can only exist one instance of EQSN
1 parent 301468e commit dbf24c0

1 file changed

Lines changed: 27 additions & 0 deletions

File tree

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
from eqsn import EQSN
2+
import time
3+
4+
5+
def test_get_instance():
6+
print("test get instance...")
7+
i1 = EQSN.get_instance()
8+
i2 = EQSN.get_instance()
9+
assert i1 == i2
10+
i1.stop_all()
11+
print("Test succesfull")
12+
13+
14+
def test_error_at_creating_EQSN_twice():
15+
error = False
16+
try:
17+
_ = EQSN()
18+
_ = EQSN()
19+
except:
20+
error = True
21+
assert error
22+
23+
24+
if __name__ == "__main__":
25+
test_get_instance()
26+
time.sleep(0.1)
27+
test_error_at_creating_EQSN_twice()

0 commit comments

Comments
 (0)