    def test_as_expected(self, mopen, mock_os):
        """
        When everything works as expected, ensure that the file is closed.
        """
        mock_fp = open.return_value
        cli.write_to_location('test/loc', 'content')
        mock_os.path.dirname.assert_called_once_with('test/loc')
        mock_os.makedirs.assert_called_once_with(mock_os.path.dirname.return_value)
        open.assert_called_once_with('test/loc', 'w+')
        mock_fp.write.assert_called_once_with('content')
        mock_fp.close.assert_called_once_with()
The software does not validate, or incorrectly validates, a certificate.