예제 #1
0
 def test_gentoo(self):
     with mock.patch.multiple('ceph_detect_init.gentoo',
                              is_systemd=(lambda: True),
                              is_openrc=(lambda: True)):
         self.assertEqual('openrc', gentoo.choose_init())
     with mock.patch.multiple('ceph_detect_init.gentoo',
                              is_systemd=(lambda: True),
                              is_openrc=(lambda: False)):
         self.assertEqual('systemd', gentoo.choose_init())
     with mock.patch.multiple('ceph_detect_init.gentoo',
                              is_systemd=(lambda: False),
                              is_openrc=(lambda: True)):
         self.assertEqual('openrc', gentoo.choose_init())
     with mock.patch.multiple('ceph_detect_init.gentoo',
                              is_systemd=(lambda: False),
                              is_openrc=(lambda: False)):
         self.assertEqual('unknown', gentoo.choose_init())
예제 #2
0
파일: test_all.py 프로젝트: ApusApp/ceph
 def test_gentoo(self):
     with mock.patch.multiple('ceph_detect_init.gentoo',
                              is_systemd=(lambda: True),
                              is_openrc=(lambda: True)):
         self.assertEqual('openrc', gentoo.choose_init())
     with mock.patch.multiple('ceph_detect_init.gentoo',
                              is_systemd=(lambda: True),
                              is_openrc=(lambda: False)):
         self.assertEqual('systemd', gentoo.choose_init())
     with mock.patch.multiple('ceph_detect_init.gentoo',
                              is_systemd=(lambda: False),
                              is_openrc=(lambda: True)):
         self.assertEqual('openrc', gentoo.choose_init())
     with mock.patch.multiple('ceph_detect_init.gentoo',
                              is_systemd=(lambda: False),
                              is_openrc=(lambda: False)):
         self.assertEqual('unknown', gentoo.choose_init())