Example #1
0
 def test_file_raises_3(self):
     with patch("opulence.common.plugins.dependencies.os.path.isfile"
                ) as mock_isfile, patch(
                    "opulence.common.plugins.dependencies.os.path.exists"
                ) as mock_exists:
         mock_isfile.return_value = True
         mock_exists.return_value = False
         d = dep.FileDependency("mockedfile")
         with self.assertRaises(FileDependencyMissing) as context:
             d.verify()
         mock_exists.assert_called_with("mockedfile")
Example #2
0
 def test_file_dep_ok(self):
     with patch("opulence.common.plugins.dependencies.os.path.isfile"
                ) as mock_isfile, patch(
                    "opulence.common.plugins.dependencies.os.path.exists"
                ) as mock_exists:
         mock_isfile.return_value = True
         mock_exists.return_value = True
         d = dep.FileDependency("mockedfile")
         d.verify()
         d.satisfied()
         mock_isfile.assert_called_with("mockedfile")
         mock_exists.assert_called_with("mockedfile")