@@ -125,23 +125,27 @@ def test_calculation_list(self):
125
125
calc_cmd .calculation_list ()
126
126
127
127
out_str = '' .join (output )
128
- self .assertTrue (calc_states .TOSUBMIT in out_str ,
129
- "The TOSUBMIT calculations should be part fo the "
130
- "simple calculation list." )
131
- self .assertTrue (calc_states .COMPUTED in out_str ,
132
- "The COMPUTED calculations should be part fo the "
133
- "simple calculation list." )
134
- self .assertFalse (calc_states .FINISHED in out_str ,
135
- "The FINISHED calculations should not be part fo the "
136
- "simple calculation list." )
128
+ self .assertTrue (
129
+ calc_states .TOSUBMIT in out_str ,
130
+ "The TOSUBMIT calculations should be part fo the "
131
+ "simple calculation list." )
132
+ self .assertTrue (
133
+ calc_states .COMPUTED in out_str ,
134
+ "The COMPUTED calculations should be part fo the "
135
+ "simple calculation list." )
136
+ self .assertFalse (
137
+ calc_states .FINISHED in out_str ,
138
+ "The FINISHED calculations should not be part fo the "
139
+ "simple calculation list." )
137
140
138
141
with Capturing () as output :
139
142
calc_cmd .calculation_list (* ['-a' ])
140
143
141
144
out_str = '' .join (output )
142
- self .assertTrue (calc_states .FINISHED in out_str ,
143
- "The FINISHED calculations should be part fo the "
144
- "simple calculation list." )
145
+ self .assertTrue (
146
+ calc_states .FINISHED in out_str ,
147
+ "The FINISHED calculations should be part fo the "
148
+ "simple calculation list." )
145
149
146
150
147
151
class TestVerdiCodeCommands (AiidaTestCase ):
@@ -193,12 +197,14 @@ def test_code_list(self):
193
197
with Capturing () as output :
194
198
code_cmd .code_list ()
195
199
out_str_1 = '' .join (output )
196
- self .assertTrue (computer_name_1 in out_str_1 ,
197
- "The computer 1 name should be included into this list" )
200
+ self .assertTrue (
201
+ computer_name_1 in out_str_1 ,
202
+ "The computer 1 name should be included into this list" )
198
203
self .assertTrue (code_name_1 in out_str_1 ,
199
204
"The code 1 name should be included into this list" )
200
- self .assertTrue (computer_name_2 in out_str_1 ,
201
- "The computer 2 name should be included into this list" )
205
+ self .assertTrue (
206
+ computer_name_2 in out_str_1 ,
207
+ "The computer 2 name should be included into this list" )
202
208
self .assertTrue (code_name_2 in out_str_1 ,
203
209
"The code 2 name should be included into this list" )
204
210
@@ -207,16 +213,18 @@ def test_code_list(self):
207
213
with Capturing () as output :
208
214
code_cmd .code_list (* ['-a' ])
209
215
out_str_2 = '' .join (output )
210
- self .assertEqual (out_str_1 , out_str_2 ,
211
- "verdi code list & verdi code list -a should provide "
212
- "the same output in this experiment." )
216
+ self .assertEqual (
217
+ out_str_1 , out_str_2 ,
218
+ "verdi code list & verdi code list -a should provide "
219
+ "the same output in this experiment." )
213
220
214
221
# Run a verdi code list -c, capture the output and check the result
215
222
with Capturing () as output :
216
223
code_cmd .code_list (* ['-c' , computer_name_1 ])
217
224
out_str = '' .join (output )
218
- self .assertTrue (computer_name_1 in out_str ,
219
- "The computer 1 name should be included into this list" )
225
+ self .assertTrue (
226
+ computer_name_1 in out_str ,
227
+ "The computer 1 name should be included into this list" )
220
228
self .assertFalse (
221
229
computer_name_2 in out_str ,
222
230
"The computer 2 name should not be included into this list" )
@@ -228,8 +236,9 @@ def test_code_list(self):
228
236
with Capturing () as output :
229
237
code_cmd .code_list ()
230
238
out_str_3 = '' .join (output )
231
- self .assertTrue (computer_name_1 in out_str_3 ,
232
- "The computer 1 name should be included into this list" )
239
+ self .assertTrue (
240
+ computer_name_1 in out_str_3 ,
241
+ "The computer 1 name should be included into this list" )
233
242
self .assertTrue (code_name_1 in out_str_3 ,
234
243
"The code 1 name should be included into this list" )
235
244
self .assertFalse (
@@ -665,12 +674,12 @@ def test_trajectory_simple_listing(self):
665
674
666
675
for nid in self .cmd_to_nodeid_map [sub_cmd ]:
667
676
if str (nid ) not in out_str :
668
- self .fail ("The data objects ({}) with ids {} and {} "
669
- "were not found. "
670
- .format (sub_cmd ,
671
- str (self .cmd_to_nodeid_map [sub_cmd ][0 ]),
672
- str (self .cmd_to_nodeid_map [sub_cmd ][1 ])) +
673
- "The output was {}" .format (out_str ))
677
+ self .fail (
678
+ "The data objects ({}) with ids {} and {} "
679
+ "were not found. " .format (
680
+ sub_cmd , str (self .cmd_to_nodeid_map [sub_cmd ][0 ]),
681
+ str (self .cmd_to_nodeid_map [sub_cmd ][1 ])) +
682
+ "The output was {}" .format (out_str ))
674
683
675
684
def test_trajectory_all_user_listing (self ):
676
685
from aiida .cmdline .commands .data import _Bands
@@ -742,10 +751,10 @@ def test_trajectory_group_listing(self):
742
751
from aiida .cmdline .commands .data import _Cif
743
752
from aiida .cmdline .commands .data import _Trajectory
744
753
745
- args_to_test = [['-g' , self .group_name ], [
746
- '--group-name' , self .group_name
747
- ], ['-G' , str (self .group_id )], [ '--group-pk' ,
748
- str (self .group_id )]]
754
+ args_to_test = [['-g' , self .group_name ],
755
+ [ '--group-name' , self .group_name ],
756
+ ['-G' , str (self .group_id )],
757
+ [ '--group-pk' , str (self .group_id )]]
749
758
750
759
sub_cmds = [_Bands , _Structure , _Cif , _Trajectory ]
751
760
for sub_cmd in sub_cmds :
@@ -755,8 +764,8 @@ def test_trajectory_group_listing(self):
755
764
curr_scmd .list (* arg )
756
765
out_str = ' ' .join (output )
757
766
758
- if str (self .cmd_to_nodeid_map_for_groups [
759
- sub_cmd ]) not in out_str :
767
+ if str (self .
768
+ cmd_to_nodeid_map_for_groups [ sub_cmd ]) not in out_str :
760
769
self .fail (
761
770
"The data object ({}) with id {} "
762
771
"was not found. " .format (
0 commit comments