curds: Clean up unused code

I added a make target for code coverage, and used that to identify code
that isn't getting run.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This commit is contained in:
Anna Schumaker 2019-02-15 16:09:09 -05:00
parent 1eac742bc4
commit f56e6764a8
3 changed files with 6 additions and 17 deletions

View File

@ -9,3 +9,9 @@ clean:
trier:
python trier/generate_tracks.py
EMMENTAL_TESTING=1 python -m unittest discover -v curds/
.PHONY:cover
cover:
python trier/generate_tracks.py
EMMENTAL_TESTING=1 coverage run -m unittest discover -v curds/
coverage report -m

View File

@ -1,5 +1,4 @@
# Copyright 2019 (c) Anna Schumaker
import asyncio
import concurrent.futures
import hashlib
import unittest
@ -64,7 +63,3 @@ class TestAlbumClass(unittest.TestCase):
self.assertIsNotNone(res[0])
self.assertEqual(res.count(res[0]), 20)
self.assertEqual(len(album.album_map), 1)
if __name__ == '__main__':
unittest.main()

View File

@ -7,19 +7,7 @@ import xdg.BaseDirectory
xdg_data_home = xdg.BaseDirectory.xdg_data_home
testing_data = os.path.join(xdg_data_home, "emmental-testing")
class Test:
def __init__(self):
self.one = 1
self.two = 2
self.list = [ 3, 4, 5]
class TestDataModule(unittest.TestCase):
def setUp(self):
path = os.path.join(testing_data, "test")
if os.path.exists(path):
os.remove(path)
def test_dir(self):
self.assertEqual(data.emmental_data, testing_data)
self.assertTrue(os.path.exists(testing_data))