def main(): """Run schiffmanandstein1970 as script""" a = GenericInputFileArgParser(obj=SchiffmanAndStein1970, methods=[('make_all', [], {})], pass_open_file=True) a.main()
def main(): """Run nogamiandli2003 as script""" a = GenericInputFileArgParser(obj=NogamiAndLi2003, methods=[('make_all', [], {})], pass_open_file=True) a.main()
def test_pattern_with_fobj(self): a = GenericInputFileArgParser(self._abc_fobj, True) args = '-d {0} -p *.txt'.format(self.tempdir.path).split() # print(args) a.main(argv=args) assert_equal(self.tempdir.read(('out.zebra'), 'utf-8').splitlines(), textwrap.dedent("""\ b1 b2""").splitlines())
def test_directory_with_path(self): a = GenericInputFileArgParser(self._abc_path, False) args = '-d {0} -p'.format(self.tempdir.path).split() print(args) a.main(argv=args) assert_equal(self.tempdir.read(('out.zebra'), 'utf-8').splitlines(), textwrap.dedent("""\ a1.py a2.py""").splitlines())
def test_filename_with_path(self): a = GenericInputFileArgParser(self._abc_path, False) args = '-f {0} {1}'.format(os.path.join(self.tempdir.path, 'a1.py'), os.path.join(self.tempdir.path, 'b1.txt')).split() # print(args) a.main(argv=args) assert_equal( self.tempdir.read(('out.zebra'), 'utf-8').splitlines(), textwrap.dedent("""\ a1.py b1.txt""").splitlines())
def test_filename_with_path(self): a = GenericInputFileArgParser(self._abc_path, False) args = '-f {0} {1}'.format( os.path.join(self.tempdir.path, 'a1.py'), os.path.join(self.tempdir.path, 'b1.txt') ).split() # print(args) a.main(argv=args) assert_equal(self.tempdir.read(('out.zebra'), 'utf-8').splitlines(), textwrap.dedent("""\ a1.py b1.txt""").splitlines())
def test_methods_with_path(self): a = GenericInputFileArgParser(HelperForGenericInputFileArgParser, False, [('dog', [], {})]) args = '-f {0} {1}'.format(os.path.join(self.tempdir.path, 'a1.py'), os.path.join(self.tempdir.path, 'b1.txt')).split() a.main(argv=args) assert_equal( self.tempdir.read(('out.zebra'), 'utf-8').splitlines(), textwrap.dedent("""\ a1.py dog b1.txt dog """).splitlines())
def test_methods_with_path(self): a = GenericInputFileArgParser(HelperForGenericInputFileArgParser, False, [('dog',[],{})]) args = '-f {0} {1}'.format( os.path.join(self.tempdir.path, 'a1.py'), os.path.join(self.tempdir.path, 'b1.txt') ).split() a.main(argv=args) assert_equal(self.tempdir.read(('out.zebra'), 'utf-8').splitlines(), textwrap.dedent("""\ a1.py dog b1.txt dog """).splitlines())