コード例 #1
0
class GenConfTestCase(unittest.TestCase):
    
    def setUp(self):
        unittest.TestCase.setUp(self)
        self._tmpdirectory = tempfile.mkdtemp()
        self.genconf = GenConf(manifest_path=resource_filename('tests.genconftests.samples', 'simple.yaml'),
                               overrides_path=resource_filename('tests.genconftests.samples', 'simple-overrides-not-existing.yaml'), 
                               templatedir=resource_filename('tests.genconftests.samples', 'templates'), 
                               targetdir=self._tmpdirectory)

        
    def test_should_generate_all_files(self): 
        self.genconf.generate()
        assert os.path.exists(os.path.join(self._tmpdirectory, 'target', 'development', 'jdbc.properties')) == True
        assert os.path.exists(os.path.join(self._tmpdirectory, 'target', 'development', 'some.xml')) == True
        assert os.path.exists(os.path.join(self._tmpdirectory, 'target', 'sometext')) == True
コード例 #2
0
def dispatch(argv):
    "run the command specified in args"
    args = parse_args(argv)
    print_settings(args)
    check_args(args)

    if (args.verbose):
        progress_listener = PrintProgressListener()
    else:
        progress_listener = DefaultGenConfEventListener()

    error_listener = PrintErrorListener(args.templatedir)

    genconf = GenConf(manifest_path=args.manifest,
                      overrides_path=args.overrides,
                      templatedir=args.templatedir,
                      targetdir=args.targetdir)
    genconf.generate(error_listener, progress_listener)

    return error_listener.exit
コード例 #3
0
ファイル: dispatch.py プロジェクト: iglootools/genconf-debian
def dispatch(argv):
    "run the command specified in args"
    args = parse_args(argv)
    print_settings(args)
    check_args(args)
    
    if(args.verbose):
        progress_listener = PrintProgressListener()
    else:
        progress_listener = DefaultGenConfEventListener()
        
    error_listener = PrintErrorListener(args.templatedir)
    
    
    genconf = GenConf(manifest_path=args.manifest,
                      overrides_path=args.overrides, 
                               templatedir=args.templatedir, 
                               targetdir=args.targetdir)
    genconf.generate(error_listener, progress_listener)
    
    return error_listener.exit
コード例 #4
0
class GenConfTestCase(unittest.TestCase):
    def setUp(self):
        unittest.TestCase.setUp(self)
        self._tmpdirectory = tempfile.mkdtemp()
        self.genconf = GenConf(
            manifest_path=resource_filename('tests.genconftests.samples',
                                            'simple.yaml'),
            overrides_path=resource_filename(
                'tests.genconftests.samples',
                'simple-overrides-not-existing.yaml'),
            templatedir=resource_filename('tests.genconftests.samples',
                                          'templates'),
            targetdir=self._tmpdirectory)

    def test_should_generate_all_files(self):
        self.genconf.generate()
        assert os.path.exists(
            os.path.join(self._tmpdirectory, 'target', 'development',
                         'jdbc.properties')) == True
        assert os.path.exists(
            os.path.join(self._tmpdirectory, 'target', 'development',
                         'some.xml')) == True
        assert os.path.exists(
            os.path.join(self._tmpdirectory, 'target', 'sometext')) == True