I hereby claim:
- I am paulgoetze on github.
- I am paulgoetze (https://keybase.io/paulgoetze) on keybase.
- I have a public key whose fingerprint is 5F17 19BA 57E1 EBFD 39CA 144A E338 4A2D 3B25 3BC9
To claim this, I am signing this object:
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'; |
assert_valid_schema(json_data, 'user.json') |
# 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') |
// tests/support/schemas/user.json | |
{ | |
"$schema": "http://json-schema.org/draft-04/schema#", | |
"title": "User response schema", | |
"type": "object", | |
"properties": { | |
"data": { | |
"type": "object", | |
"properties": { |
# tests/support/assertions.py | |
import json | |
from os.path import join, dirname | |
from jsonschema import validate | |
def assert_valid_schema(data, schema_file): | |
""" Checks whether the given data matches the schema """ |
def test_get_user(client): | |
# Do whatever is necessary to create a user here… | |
response = client.get('/users/1') | |
json_data = json.loads(response.data) | |
assert 'data' in json_data | |
assert 'type' in json_data['data'] | |
assert 'id' in json_data['data'] | |
assert 'attributes' in json_data['data'] |
{ | |
"data": { | |
"type": "users", | |
"id": 1, | |
"attributes": { | |
"email": "[email protected]", | |
"username": "paul" | |
} | |
} | |
} |
# This module provides a function to compile city data using the free data | |
# provided on http://download.geonames.org/export/dump. | |
# It uses following files to compile a list of 4.4 mio. cities world-wide, | |
# including their name, state (administrative level 1), country, time zone, | |
# latitude, and longitude: | |
# | |
# * allCountries.txt (included in allCountries.zip) | |
# * countryInfo.txt | |
# * admin1CodesASCII.txt | |
# |
from os import path | |
from io import BytesIO | |
from sqlalchemy_media import Store | |
from sqlalchemy_media.typing_ import FileLike | |
from sqlalchemy_media.constants import KB | |
from google.cloud import storage | |
class GoogleCloudStore(Store): | |
""" Store for dealing with Google Cloud Storage """ |
I hereby claim:
To claim this, I am signing this object: