mirror of
https://github.com/rembo10/headphones.git
synced 2026-07-22 08:53:59 +01:00
Fixed tests
This commit is contained in:
@@ -5,3 +5,6 @@ from unittest import TestCase
|
|||||||
import headphones.albumart
|
import headphones.albumart
|
||||||
|
|
||||||
# no tests...
|
# no tests...
|
||||||
|
class AlbumArtTest(TestCase):
|
||||||
|
def test_nothing(self):
|
||||||
|
self.assertTrue(True)
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#import unittest
|
#import unittest
|
||||||
#import mock
|
import mock
|
||||||
from unittest import TestCase
|
from unittest import TestCase
|
||||||
from mock import Mock, MagicMock
|
from mock import Mock, MagicMock
|
||||||
|
|
||||||
@@ -33,7 +33,7 @@ class ConfigPathTest(TestCase):
|
|||||||
def test_path_repr(self):
|
def test_path_repr(self):
|
||||||
s = '/tmp'
|
s = '/tmp'
|
||||||
p1 = path(s)
|
p1 = path(s)
|
||||||
self.assertIn('headphones.config.path', p1.__repr__() )
|
self.assertIn('headphones.config.path', p1.__repr__())
|
||||||
|
|
||||||
|
|
||||||
import headphones.config
|
import headphones.config
|
||||||
@@ -45,7 +45,7 @@ class ConfigTest(TestCase):
|
|||||||
def putConfigToFabric(self, config_obj_fabric_mock):
|
def putConfigToFabric(self, config_obj_fabric_mock):
|
||||||
""" Helper for setting up the config_obj_fabric"""
|
""" Helper for setting up the config_obj_fabric"""
|
||||||
|
|
||||||
config_obj_mock = MagicMock( )
|
config_obj_mock = MagicMock()
|
||||||
config_obj_fabric_mock.return_value = config_obj_mock
|
config_obj_fabric_mock.return_value = config_obj_mock
|
||||||
return config_obj_mock
|
return config_obj_mock
|
||||||
|
|
||||||
@@ -71,6 +71,5 @@ class ConfigTest(TestCase):
|
|||||||
self.assertEqual(conf_mock.filename, path)
|
self.assertEqual(conf_mock.filename, path)
|
||||||
|
|
||||||
general_opts_set = conf_mock['General'].__setitem__.call_args_list
|
general_opts_set = conf_mock['General'].__setitem__.call_args_list
|
||||||
general_opts_set = map( lambda x : x[0][0], general_opts_set )
|
general_opts_set = map(lambda x: x[0][0], general_opts_set)
|
||||||
self.assertIn('download_dir', general_opts_set , 'There is no download_dir in ConfigObj (submodule of Config)')
|
self.assertIn('download_dir', general_opts_set, 'There is no download_dir in ConfigObj (submodule of Config)')
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user