Exemplo n.º 1
0
def main( args ):    
    parser = argparse.ArgumentParser( description = 'Install tool to install files from one location to another.' )
    parser.add_argument( 'src', nargs='+' )
    parser.add_argument( 'dest' )

    params = parser.parse_args( args[1:] )    

    act = CopyAction( params.src, params.dest  )
    act.action()

    return 0
Exemplo n.º 2
0
    def test_action( self ):
        self.assertTrue( "data/tmp/"[-1] == os.sep )

        act = CopyAction( [ "data/*.txt" ], "data/tmp/" )
        act.action()
        self.assertFalse( act.isChanged( "data/test_fileDevices.txt", "data/tmp/test_fileDevices.txt" ) )

        act = CopyAction( [ "data/tmp/*.txt" ], "data/tmp/tmp.txt" )
        act.action()
        self.assertFalse( act.isChanged( "data/tmp/test_fileDevices.txt", "data/tmp/tmp.txt" ) )
Exemplo n.º 3
0
 def test_init( self ):
     act = CopyAction( [ '*.py' ], "/" )
     self.assertEqual( act.getSources(), [ '*.py' ] )
     self.assertEqual( act.getDest(), "/" )