Rename test_pylast_example.yaml -> example_test_pylast.yaml (makes tab-autocompletion happier)
This commit is contained in:
parent
c57afec43f
commit
954e32a819
|
@ -61,7 +61,7 @@ Testing
|
||||||
|
|
||||||
test_pylast.py contains integration tests with Last.fm, and plenty of code examples.
|
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
|
export PYLAST_USERNAME=TODO_ENTER_YOURS_HERE
|
||||||
|
|
|
@ -6,14 +6,14 @@ import os
|
||||||
from random import choice
|
from random import choice
|
||||||
import time
|
import time
|
||||||
import unittest
|
import unittest
|
||||||
import yaml # pip install pyyaml
|
|
||||||
|
|
||||||
import pylast
|
import pylast
|
||||||
|
|
||||||
def load_secrets():
|
def load_secrets():
|
||||||
secrets_file = "test_pylast.yaml"
|
secrets_file = "test_pylast.yaml"
|
||||||
if os.path.isfile(secrets_file):
|
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)
|
doc = yaml.load(f)
|
||||||
else:
|
else:
|
||||||
doc = {}
|
doc = {}
|
||||||
|
|
Loading…
Reference in a new issue