2828
2929class BasicTest (unittest .TestCase ):
3030 def test_simple_about_command_line_can_run (self ):
31- testpath = tempfile .NamedTemporaryFile (suffix = '.csv' , delete = True )
32- tst_fn = testpath .name
33- testpath .close ()
34- shutil .rmtree (tst_fn , ignore_errors = True )
35- assert about .main (['about.ABOUT' , tst_fn ], []) == None
36- self .assertTrue (len (open (tst_fn ).read ()) > 10 )
37- shutil .rmtree (tst_fn , ignore_errors = True )
31+ test_path = tempfile .NamedTemporaryFile (suffix = '.csv' , delete = True )
32+ test_filename = test_path .name
33+ test_path .close ()
34+ shutil .rmtree (test_filename , ignore_errors = True )
35+ parser = about .get_parser ()
36+ args = parser .parse_args (['about.ABOUT' , test_filename ])
37+
38+ assert about .main (parser , args ) == None
39+ self .assertTrue (len (open (test_filename ).read ()) > 10 )
40+ shutil .rmtree (test_filename , ignore_errors = True )
3841
3942 def test_return_path_is_not_abspath_and_contains_subdirs_on_file (self ):
4043 test_input = "testdata/thirdparty/django_snippets_2413.ABOUT"
@@ -43,7 +46,7 @@ def test_return_path_is_not_abspath_and_contains_subdirs_on_file(self):
4346 os .remove (test_output )
4447 except OSError :
4548 pass
46- collector = about .AboutCollector (test_input , test_output , '0' )
49+ collector = about .AboutCollector (test_input , test_output , 0 )
4750 collector .extract_about_info ()
4851 self .assertTrue (open (test_output ).read ().partition ('\n ' )[2 ].startswith ('testdata/thirdparty/django_snippets_2413.ABOUT' ))
4952 os .remove (test_output )
@@ -55,7 +58,7 @@ def test_return_path_is_not_abspath_and_contains_subdirs_on_dir(self):
5558 os .remove (test_output )
5659 except OSError :
5760 pass
58- collector = about .AboutCollector (test_input , test_output , '0' )
61+ collector = about .AboutCollector (test_input , test_output , 0 )
5962 collector .extract_about_info ()
6063 self .assertTrue (open (test_output ).read ().partition ('\n ' )[2 ].startswith ('testdata/basic' ))
6164 os .remove (test_output )
0 commit comments