コード例 #1
0
 def test_create(self, p_mkdir):
     '''
     Test that the create() method properly creates the .paro
     directory using os.mkdir.
     '''
     dd = DotDir()
     dd.create()
     p_mkdir.assert_called_once_with('.paro')
コード例 #2
0
ファイル: paro.py プロジェクト: austinhartzheim/paro
    # Parse arguments
    args = parser.parse_args()

    # Initial setup
    if args.info:
        logger.setLevel(logging.INFO)
    if args.warning:
        logger.setLevel(logging.WARN)

    # Execute subcommand
    if args.subcommand == 'init':
        # Create .paro directory and paro.yaml file
        try:
            dotdir = DotDir()
            dotdir.create()
            logger.info('Created .paro directory at: %s' % dotdir.path)
        except errors.DotDirAlreadyExists:
            logger.error('The .paro directory already exists.')
            logger.error('Aborting!')
            exit(1)

        try:
            parofile = ParoFile()
            parofile.create()
            logger.info('Created paro.yaml file at: %s' % parofile.path)
        except errors.ParoFileAlreadyExists:
            logger.error('The paro.yaml file already exists.')
            logger.error('Aborting!')
            exit(1)