コード例 #1
0
ファイル: test_cache.py プロジェクト: Benzhaomin/franck
  def test_expire_not_expired(self, foo):
    filename = 'somefile'

    # make sure os.remove was not called
    with patch('franck.io.cache.os.remove') as m:
      _expire(filename)
      self.assertEqual(len(m.mock_calls), 0)
コード例 #2
0
ファイル: test_cache.py プロジェクト: Benzhaomin/franck
  def test_expire_expired(self, foo):
    filename = 'somefile'
    path = os.path.join(CACHEDIR, filename)

    # make sure os.remove was called on the cached file
    with patch('franck.io.cache.os.remove') as m:
      _expire(filename)
      m.assert_called_once_with(path)