Skip to content

Commit

Permalink
Add Coveralls & Better Unit Tests
Browse files Browse the repository at this point in the history
Signed-off-by: alexgurrola <[email protected]>
  • Loading branch information
alexgurrola committed Aug 8, 2019
1 parent d641893 commit 8c85124
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 19 deletions.
2 changes: 2 additions & 0 deletions .coveralls.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
service_name: travis-pro
repo_token: nyWOoWiOMdQPnq13jqi7IKisJYQ1Zf4ER
3 changes: 3 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ snakelet
.. image:: https://travis-ci.com/alexgurrola/snakelet.svg?branch=master
:target: https://travis-ci.com/alexgurrola/snakelet

.. image:: http://img.shields.io/coveralls/alexgurrola/snakelet/master.svg
:target: https://coveralls.io/r/alexgurrola/snakelet

.. image:: https://scrutinizer-ci.com/g/alexgurrola/snakelet/badges/quality-score.png?b=master
:target: https://scrutinizer-ci.com/g/alexgurrola/snakelet/?branch=master

Expand Down
30 changes: 11 additions & 19 deletions tests/test_connect.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,22 +51,23 @@ def test_create_batch():
owner = manager.collection('Owner').find_one({'name': 'Schrödinger'})
assert owner is not None
# save count
# manager.Cat.count()
initial_count = manager.collection('Cat').collection.count()
# create
batch = 10
cats = []
batch = 20
# cats = []
for x in range(batch):
# create reference
cat = Cat()
cats.append(cat)
# cats.append(cat)
# add data
cat['name'] = '{1} {0}'.format(str(x), 'Pyewacket' if x % 2 == 0 else 'Shoshana')
# add reference
cat['owner'] = owner
# persist entire list
manager.collection('Cat').save(cats)
# persist object
manager.collection('Cat').save(cat)
# assert count is test_set more
assert True
complete_count = manager.collection('Cat').collection.count()
assert initial_count == complete_count - batch


def test_page():
Expand All @@ -75,20 +76,11 @@ def test_page():
results = manager.Test.find({'name': 1})
result_count = results.count()
"""
# result_count = manager.Test.collection.count()
# print('count:', result_count)
#
# if result_count < 10:
# filler = []
# for x in range(0, 10):
# data = Test({'value': x})
# filler.append(data)
# manager.save(data)
#
# for page in manager.Test.paginate(find={'name': 1}):
# for page in manager.collection('Cat').paginate(find={'name': 1}, size=5):
# print(len(page))
# for test in page:
# print(test)

#
assert True


Expand Down

0 comments on commit 8c85124

Please sign in to comment.