diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..adf4ff7 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,4 @@ +language: python +python: + - "3.7.1" +script: make test \ No newline at end of file diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index e69de29..0000000 diff --git a/setup.py b/setup.py index b57c29b..ca9c286 100644 --- a/setup.py +++ b/setup.py @@ -1,5 +1,10 @@ from distutils.core import setup + setup(name='deadsimplekv', version='0.0.0', - py_modules=['deadsimplekv'], - ) \ No newline at end of file + description='Very simple key-value store for Python', + author='Kevin Froman', + author_email='beardog@firemail.cc', + url='https://github.com/beardog108/deadsimplekv', + packages=['deadsimplekv'], + ) \ No newline at end of file diff --git a/tests/test_basic.py b/tests/test_basic.py index f22bbbb..b0f9c0a 100644 --- a/tests/test_basic.py +++ b/tests/test_basic.py @@ -1,3 +1,20 @@ +''' + DeadSimpleKv. An extremely simple key-value storage system with cache + Copyright (C) 2019 Kevin Froman + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +''' import sys, os, unittest, json, time, math, uuid sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../") import deadsimplekv @@ -32,6 +49,16 @@ class TestInit(unittest.TestCase): kv.put('meme', 'doge') kv2 = deadsimplekv.DeadSimpleKV(test_id) self.assertIsNone(kv2.get('meme')) + + def test_manual_refresh(self): + test_id = get_test_id() + kv = deadsimplekv.DeadSimpleKV(test_id, refresh_seconds=None) + kv2 = deadsimplekv.DeadSimpleKV(test_id) + + kv2.put('test', True) + self.assertIsNone(kv.get('test')) + kv.refresh() + self.assertTrue(kv.get('test')) def test_none(self): kv = deadsimplekv.DeadSimpleKV(get_test_id())