Merge "Fix unit tests for OSX"
This commit is contained in:
commit
c3345e4657
@ -64,20 +64,6 @@ class TestAmphoraInfo(base.TestCase):
|
|||||||
self.assertEqual(1, result)
|
self.assertEqual(1, result)
|
||||||
|
|
||||||
def test__get_meminfo(self):
|
def test__get_meminfo(self):
|
||||||
|
|
||||||
# Test live data from host
|
|
||||||
|
|
||||||
result = self.amp_info._get_meminfo()
|
|
||||||
|
|
||||||
# check that /proc/meminfo is giving us the fields we use
|
|
||||||
self.assertIn('MemTotal', result)
|
|
||||||
self.assertIn('MemFree', result)
|
|
||||||
self.assertIn('Buffers', result)
|
|
||||||
self.assertIn('Cached', result)
|
|
||||||
self.assertIn('SwapCached', result)
|
|
||||||
self.assertIn('Shmem', result)
|
|
||||||
self.assertIn('Slab', result)
|
|
||||||
|
|
||||||
# Known data test
|
# Known data test
|
||||||
meminfo = ('MemTotal: 21692784 kB\n'
|
meminfo = ('MemTotal: 21692784 kB\n'
|
||||||
'MemFree: 12685624 kB\n'
|
'MemFree: 12685624 kB\n'
|
||||||
|
@ -34,6 +34,8 @@ class ListenerTestCase(base.TestCase):
|
|||||||
self.jinja_cfg = jinja_cfg.JinjaTemplater(
|
self.jinja_cfg = jinja_cfg.JinjaTemplater(
|
||||||
base_amp_path=BASE_AMP_PATH,
|
base_amp_path=BASE_AMP_PATH,
|
||||||
base_crt_dir=BASE_CRT_PATH)
|
base_crt_dir=BASE_CRT_PATH)
|
||||||
|
self.mock_platform = mock.patch("platform.linux_distribution").start()
|
||||||
|
self.mock_platform.return_value = ("Ubuntu",)
|
||||||
self.test_listener = listener.Listener()
|
self.test_listener = listener.Listener()
|
||||||
|
|
||||||
def test_parse_haproxy_config(self):
|
def test_parse_haproxy_config(self):
|
||||||
|
@ -37,6 +37,8 @@ class TestPlug(base.TestCase):
|
|||||||
def setUp(self):
|
def setUp(self):
|
||||||
super(TestPlug, self).setUp()
|
super(TestPlug, self).setUp()
|
||||||
self.mock_netifaces = mock.patch.object(plug, "netifaces").start()
|
self.mock_netifaces = mock.patch.object(plug, "netifaces").start()
|
||||||
|
self.mock_platform = mock.patch("platform.linux_distribution").start()
|
||||||
|
self.mock_platform.return_value = ("Ubuntu",)
|
||||||
self.osutil = osutils.BaseOS.get_os_util()
|
self.osutil = osutils.BaseOS.get_os_util()
|
||||||
self.test_plug = plug.Plug(self.osutil)
|
self.test_plug = plug.Plug(self.osutil)
|
||||||
self.addCleanup(self.mock_netifaces.stop)
|
self.addCleanup(self.mock_netifaces.stop)
|
||||||
@ -157,6 +159,8 @@ class TestPlug(base.TestCase):
|
|||||||
class TestPlugNetwork(base.TestCase):
|
class TestPlugNetwork(base.TestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
super(TestPlugNetwork, self).setUp()
|
super(TestPlugNetwork, self).setUp()
|
||||||
|
self.mock_platform = mock.patch("platform.linux_distribution").start()
|
||||||
|
self.mock_platform.return_value = ("Ubuntu",)
|
||||||
self.osutil = osutils.BaseOS.get_os_util()
|
self.osutil = osutils.BaseOS.get_os_util()
|
||||||
self.test_plug = plug.Plug(self.osutil)
|
self.test_plug = plug.Plug(self.osutil)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user