How to use the puppetboard.app.app.config function in puppetboard

To help you get started, we’ve selected a few puppetboard examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github voxpupuli / puppetboard / test / test_app.py View on Github external
'reports': [
            [{'status': 'changed', 'count': 1}]
            for i in range(app.app.config['DAILY_REPORTS_CHART_DAYS'])
        ]
    }

    dbquery = MockDbQuery(query_data)

    mocker.patch.object(app.puppetdb, '_query', side_effect=dbquery.get)

    rv = client.get('/daily_reports_chart.json')
    result_json = json.loads(rv.data.decode('utf-8'))

    assert 'result' in result_json
    assert (len(result_json['result']) ==
            app.app.config['DAILY_REPORTS_CHART_DAYS'])
    day_format = '%Y-%m-%d'
    cur_day = datetime.strptime(result_json['result'][0]['day'], day_format)
    for day in result_json['result'][1:]:
        next_day = datetime.strptime(day['day'], day_format)
        assert cur_day < next_day
        cur_day = next_day

    assert rv.status_code == 200
github voxpupuli / puppetboard / dev.py View on Github external
if os.environ.get('WERKZEUG_RUN_MAIN') is None:
        try:
            subprocess.Popen([
                app.config['DEV_COFFEE_LOCATION'], '-w', '-c',
                '-o', 'puppetboard/static/js',
                'puppetboard/static/coffeescript'
            ])
        except OSError:
            app.logger.error(
                'The coffee executable was not found, disabling automatic '
                'CoffeeScript compilation'
            )

    # Start the Flask development server
    app.debug = True
    app.run(app.config['DEV_LISTEN_HOST'], app.config['DEV_LISTEN_PORT'])