|
20 | 20 | Vsource, Transformer, LineCode, Load, Line, Capacitor, |
21 | 21 | Connection as Conn, RegControl, LengthUnit as Units, |
22 | 22 | LoadModel, Edit, AltDSS, altdss, LineGeometry, LineSpacing, |
| 23 | + DSSException |
23 | 24 | ) |
24 | 25 |
|
25 | 26 | def create_ref_ckt13(ref): |
@@ -800,6 +801,32 @@ def test_obj_setter(): |
800 | 801 | assert all(l.Daily == default_shape for l in altdss.Load) |
801 | 802 |
|
802 | 803 |
|
| 804 | +def test_new(): |
| 805 | + altdss.Clear() |
| 806 | + altdss('new circuit.test') |
| 807 | + altdss('new transformer.A') |
| 808 | + with pytest.raises(DSSException): |
| 809 | + altdss('new transformer.A') |
| 810 | + |
| 811 | + assert 'a' in altdss.Transformer.Name |
| 812 | + |
| 813 | + with pytest.raises(DSSException): |
| 814 | + altdss.Transformer.new('A') |
| 815 | + |
| 816 | + with pytest.raises(DSSException): |
| 817 | + altdss.Transformer.batch_new(['A']) |
| 818 | + |
| 819 | + altdss.Transformer.new('B') |
| 820 | + with pytest.raises(DSSException): |
| 821 | + altdss('new transformer.B') |
| 822 | + |
| 823 | + with pytest.raises(DSSException): |
| 824 | + altdss.Transformer.new('B') |
| 825 | + |
| 826 | + with pytest.raises(DSSException): |
| 827 | + altdss.Transformer.batch_new(['B']) |
| 828 | + |
| 829 | + |
803 | 830 | if __name__ == '__main__': |
804 | 831 | # Adjust for manual running a test-case |
805 | 832 | test_register_values() |
0 commit comments