[tests] Purge tests and start with a clean implementation of subprocess

Seems like subprocess and friends (Popen, communicate) are not so easy
to mock cleanly. Therefore, start from scratch and carefully write test
by test, until (at least) the old test coverage has been restored.
This commit is contained in:
Tobi-wan Kenobi 2017-03-04 11:25:52 +01:00
parent 1c6122fc3f
commit 6dbe440cb5
23 changed files with 61 additions and 1240 deletions

View file

@ -1,24 +0,0 @@
# pylint: disable=C0103,C0111,W0703
import unittest
from bumblebee.store import Store
class TestStore(unittest.TestCase):
def setUp(self):
self.store = Store()
self.anyKey = "some-key"
self.anyValue = "some-value"
self.unsetKey = "invalid-key"
def test_set_value(self):
self.store.set(self.anyKey, self.anyValue)
self.assertEquals(self.store.get(self.anyKey), self.anyValue)
def test_get_invalid_value(self):
result = self.store.get(self.unsetKey)
self.assertEquals(result, None)
def test_get_invalid_with_default_value(self):
result = self.store.get(self.unsetKey, self.anyValue)
self.assertEquals(result, self.anyValue)