Exemplo n.º 1
0
 def test_not_mounting_if_ok(self):
     fstab_mounts = {"/some/folder": {"cifs_share": "some//cifs"}}
     mtab_mounts = fstab_mounts
     with patch("serverscripts.cifsfixer._is_folder_accessible") as mocked1:
         mocked1.return_value = True
         with patch("serverscripts.cifsfixer._mount") as mocked2:
             cifsfixer.check_if_mounted(fstab_mounts, mtab_mounts)
             self.assertFalse(mocked2.called)
Exemplo n.º 2
0
 def test_matching_mounts(self):
     mounts = {"/some/folder": {"cifs_share": "some//cifs"}}
     with patch("serverscripts.cifsfixer._is_folder_accessible") as mocked:
         mocked.return_value = True
         self.assertEqual(0, cifsfixer.check_if_mounted(mounts, mounts))
Exemplo n.º 3
0
 def test_mounting_missing_mount(self):
     fstab_mounts = {"/some/folder": {"cifs_share": "some//cifs"}}
     mtab_mounts = {}
     with patch("serverscripts.cifsfixer._mount") as mocked:
         cifsfixer.check_if_mounted(fstab_mounts, mtab_mounts)
         self.assertTrue(mocked.called)
Exemplo n.º 4
0
 def test_empty(self):
     self.assertEqual(0, cifsfixer.check_if_mounted({}, {}))