From 954e32a819de7ed352492499ec2c62ecd13dc0e1 Mon Sep 17 00:00:00 2001 From: hugovk Date: Mon, 3 Mar 2014 08:59:36 +0200 Subject: [PATCH] Rename test_pylast_example.yaml -> example_test_pylast.yaml (makes tab-autocompletion happier) --- README.md | 6 +++--- test_pylast_example.yaml => example_test_pylast.yaml | 0 test_pylast.py | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) rename test_pylast_example.yaml => example_test_pylast.yaml (100%) diff --git a/README.md b/README.md index d9320db..051b4fe 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ API_SECRET = "425b55975eed76058ac220b7b4e8a054" username = "your_user_name" password_hash = pylast.md5("your_password") -network = pylast.LastFMNetwork(api_key = API_KEY, api_secret = +network = pylast.LastFMNetwork(api_key = API_KEY, api_secret = API_SECRET, username = username, password_hash = password_hash) # now you can use that object everywhere @@ -61,7 +61,7 @@ Testing test_pylast.py contains integration tests with Last.fm, and plenty of code examples. -You need a test account at Last.fm that can be cluttered with test data, and an API key and secret. Either copy test_pylast_example.yaml to test_pylast.yaml and fill out the credentials, or set them as environment variables like: +You need a test account at Last.fm that can be cluttered with test data, and an API key and secret. Either copy example_test_pylast.yaml to test_pylast.yaml and fill out the credentials, or set them as environment variables like: ``` export PYLAST_USERNAME=TODO_ENTER_YOURS_HERE @@ -78,7 +78,7 @@ pip install pyyaml To run with coverage: ``` -pip install +pip install pip install coverage coverage run --source=pylast ./test_pylast.py coverage report # for command-line report diff --git a/test_pylast_example.yaml b/example_test_pylast.yaml similarity index 100% rename from test_pylast_example.yaml rename to example_test_pylast.yaml diff --git a/test_pylast.py b/test_pylast.py index 16ead83..c41a87b 100755 --- a/test_pylast.py +++ b/test_pylast.py @@ -6,14 +6,14 @@ import os from random import choice import time import unittest -import yaml # pip install pyyaml import pylast def load_secrets(): secrets_file = "test_pylast.yaml" if os.path.isfile(secrets_file): - with open(secrets_file, "r") as f: # see test_pylast_example.yaml + import yaml # pip install pyyaml + with open(secrets_file, "r") as f: # see example_test_pylast.yaml doc = yaml.load(f) else: doc = {}