Skip to content

Commit

Permalink
change name of store
Browse files Browse the repository at this point in the history
  • Loading branch information
carlomorelli committed Apr 12, 2018
1 parent 11de37a commit 296a5e9
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Music and media repository for your NAS, written in Python


## About
_acrewstic_ is implemented as a RESTful API using Python 2.7 with Flask library (http://flask.pocoo.org/).
_acrewstic_ is implemented as a RESTful API using Python3 with Flask library (http://flask.pocoo.org/).
A JS frontend will be provided in the future.

The API is implemented for POST, PUT, GET, DELETE methods. It can be triggered as follows using `curl`:
Expand Down
2 changes: 1 addition & 1 deletion src/acrewlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from redis import StrictRedis


class Store:
class Repository:

def __init__(self, host, port):
self.r = StrictRedis(host=host, port=port)
Expand Down
6 changes: 3 additions & 3 deletions src/acrewstic.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from flask import Flask, jsonify, abort, request, make_response
from .acrewlib import Store
from .acrewlib import Repository

app = Flask(__name__)

store = Store(host='localhost', port=6379)
repository = Repository(host='localhost', port=6379)


"""
Expand Down Expand Up @@ -103,7 +103,7 @@ def get_version():
'version': '0.11.1'
}
try:
redis_info = store.r.info()
redis_info = repository.r.info()
except:
redis_info = '<<<Unable to connect to database>>>'
return jsonify({
Expand Down
7 changes: 4 additions & 3 deletions test/test_data_store.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import mock
from nose import with_setup
from src.acrewlib import Store
from src.acrewlib import Repository

TEST_KEY_STORE = 'test_key_store'
test_string = 'test1'
Expand All @@ -8,12 +9,12 @@
test_list = range(1, 11)


class TestDataStore:
class RepositoryTest:

@classmethod
def setup_class(cls):
print("Setting up store...")
cls.store = Store(host='localhost', port=6379)
cls.store = Repository(host='localhost', port=6379)

# self.db_filedescriptor, acrewstic.app.config['DATABASE']
# = tempfile.mkstemp()
Expand Down

0 comments on commit 296a5e9

Please sign in to comment.