def test_exists(self, mock_exists): """Return True if file specified by self.file_name exists.""" rdf = RedirectsFile('/tmp/foo.json') mock_exists.return_value = True assert rdf.exists() mock_exists.return_value = False assert not rdf.exists() mock_exists.assert_called_with('/tmp/foo.json')