Skip to content

Instantly share code, notes, and snippets.

@paulgoetze
paulgoetze / user.json
Last active April 29, 2022 10:32
Testing Your Python API App with JSON Schema - tests/support/schemas/user.json
// tests/support/schemas/user.json
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "User response schema",
"type": "object",
"properties": {
"data": {
"type": "object",
"properties": {
@paulgoetze
paulgoetze / test_users.py
Last active May 30, 2017 16:46
Testing Your Python API App with JSON Schema - tests/test_users.py
# tests/test_users.py
import json
from .support.assertions import assert_valid_schema
def test_get_user(client):
# Do whatever is necessary to create a user here…
response = client.get('/users/1')
@paulgoetze
paulgoetze / assert_valid_schema.py
Last active May 30, 2017 16:43
Testing Your Python API App with JSON Schema - assert_valid_schema
assert_valid_schema(json_data, 'user.json')
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
hifi: Ember.inject.service(),
actions: {
play() {
const url = "https://stream.wqxr.org/wqxr";
const mimeType = 'audio/mpeg';