Clean artifacts after running Ring tests. (#6944)

* Clean artifacts after running Ring tests.

* Clean artifacts from top level test_ring.py
This commit is contained in:
Marcelo Moreira de Mello authored and Pascal Vizeli committed 2017-04-05 11:26:56 +02:00
1 parent 534187f4cd
commit a5f77d5f46
3 files changed
+30 -3

No files matched your search

+10 -1
View File
@@ -1,11 +1,13 @@
"""The tests for the Ring component."""
import os
import unittest
import requests_mock
from homeassistant import setup
import homeassistant.components.ring as ring
from tests.common import get_test_home_assistant, load_fixture
from tests.common import (
get_test_config_dir, get_test_home_assistant, load_fixture)
ATTRIBUTION = 'Data provided by Ring.com'
@@ -20,14 +22,21 @@ VALID_CONFIG = {
class TestRing(unittest.TestCase):
"""Tests the Ring component."""
def cleanup(self):
"""Cleanup any data created from the tests."""
if os.path.isfile(self.cache):
os.remove(self.cache)
def setUp(self):
"""Initialize values for this test case class."""
self.hass = get_test_home_assistant()
self.cache = get_test_config_dir(ring.DEFAULT_CACHEDB)
self.config = VALID_CONFIG
def tearDown(self): # pylint: disable=invalid-name
"""Stop everything that was started."""
self.hass.stop()
self.cleanup()
@requests_mock.Mocker()
def test_setup(self, mock):