Ejemplo n.º 1
0
    def test_utimes(self):
        mocked_utimes = MagicMock()
        mocked_utimes.return_value = "magic"

        with patch('gitfs.views.passthrough.os.utime', mocked_utimes):
            view = PassthroughView(repo=self.repo, repo_path=self.repo_path)
            result = view.utimens("/magic/path", "times")

            assert result == "magic"
            path = '/the/root/path/magic/path'
            mocked_utimes.assert_called_once_with(path, "times")
Ejemplo n.º 2
0
    def test_utimes(self):
        mocked_utimes = MagicMock()
        mocked_utimes.return_value = "magic"

        with patch('gitfs.views.passthrough.os.utime', mocked_utimes):
            view = PassthroughView(repo=self.repo, repo_path=self.repo_path)
            result = view.utimens("/magic/path", "times")

            assert result == "magic"
            path = '/the/root/path/magic/path'
            mocked_utimes.assert_called_once_with(path, "times")