Exemplo n.º 1
0
def distributions():

    limit = request.args.get('limit', 100)
    dists = get_all_distributions(limit=limit)
    channels = get_channels()

    return jsonify({'d': {'dists': dists, 'chans': channels}})
Exemplo n.º 2
0
def distributions():

    limit = request.args.get('limit', 100)
    dists = get_all_distributions(limit=limit)
    channels = get_channels()

    return jsonify({'d': {'dists': dists, 'chans': channels}})
Exemplo n.º 3
0
def init_data():
    """
    Initial data provided to the upcoming page
    """
    dists = get_upcoming_distributions()
    chans = get_channels()

    return jsonify({'d': {'dists': dists, 'chans': chans, 'schema': schema, 'env': env.config.ENVIRONMENT}})
Exemplo n.º 4
0
def distributions():
    """
    Obtain upcoming distributions
    """

    limit = request.args.get('limit', 100)
    dists = get_upcoming_distributions(limit=limit)
    channels = get_channels()

    return jsonify({'d': {'dists': dists, 'chans': channels}})
Exemplo n.º 5
0
def distributions():
    """
    Obtain upcoming distributions
    """

    limit = request.args.get('limit', 100)
    dists = get_upcoming_distributions(limit=limit)
    channels = get_channels()

    return jsonify({'d': {'dists': dists, 'chans': channels}})
Exemplo n.º 6
0
def init_data():
    """
    Initial data provided to the upcoming page
    """
    dists = get_upcoming_distributions()
    chans = get_channels()

    return jsonify({
        'd': {'dists': dists, 'chans': chans,
              'schema': {"default": get_payload_schema(compact=False), "compact": get_payload_schema(compact=True)},
              'env': env.config.ENVIRONMENT}})
Exemplo n.º 7
0
    def test_empty(self):
        """
        Test when there is no deployed distributions
        """
        response = self.client.get(url_for('api.authoring.distributions'))
        chans = get_channels()
        expected = json.loads(json.dumps({
            'd': {
                'dists': {},
                'chans': chans
            }
        }))

        assert_equal(expected, response.json)
Exemplo n.º 8
0
    def test_distributions(self):
        self.insert_distro()

        response = self.client.get(url_for('api.upcoming.distributions'))
        dists = get_upcoming_distributions()
        chans = get_channels()

        # need to dump using the Flask json serializer to match types
        # for datetime etc
        expected = json.loads(
            json.dumps({'d': {
                'dists': dists,
                'chans': chans,
            }}))
        assert_equal(expected, response.json)
Exemplo n.º 9
0
    def test_simple(self):
        """
        Simple distribution test
        """
        self.insert_distro()
        response = self.client.get(url_for('api.authoring.distributions'))
        chans = get_channels()
        dists = get_all_distributions()
        expected = json.loads(json.dumps({
            'd': {
                'dists': dists,
                'chans': chans
            }
        }))

        assert_equal(expected, response.json)
Exemplo n.º 10
0
    def test_distributions(self):
        self.insert_distro()

        response = self.client.get(url_for('api.upcoming.distributions'))
        dists = get_upcoming_distributions()
        chans = get_channels()

        # need to dump using the Flask json serializer to match types
        # for datetime etc
        expected = json.loads(json.dumps({
            'd': {
                'dists': dists,
                'chans': chans,
            }
        }))
        assert_equal(expected, response.json)
Exemplo n.º 11
0
def init_data():
    """
    Initial data provided to the upcoming page
    """
    dists = get_upcoming_distributions()
    chans = get_channels()

    return jsonify({
        'd': {
            'dists': dists,
            'chans': chans,
            'schema': {
                "default": get_payload_schema(compact=False),
                "compact": get_payload_schema(compact=True)
            },
            'env': env.config.ENVIRONMENT
        }
    })