def test_request_date_kml(self):
        """
        14. Request tile with date via KML
        """
        # Note that we can't directly test the KML against a hash as the generated file changes based on the server settings
        req_url = 'http://localhost/onearth/test/twms/kmlgen.cgi?layers=test_weekly_jpg&time=2012-02-29'
        search_string = '<name>2012-02-29 test_weekly_jpg</name>'
        if DEBUG:
            print '\nTesting: Request tile with date via KML'
            print 'URL: ' + req_url

        response = get_url(req_url)
        
        # Check if the response is valid XML
        try:
            xml.dom.minidom.parse(response)
            xml_check = True
        except xml.parsers.expat.ExpatError:
            xml_check = False
        self.assertTrue(xml_check, 'KML response is not a valid XML file. URL: ' + req_url)

        # Check if layer name is in KML result
        check_result = all(line for line in response if line in search_string)
        self.assertTrue(check_result, 'Layer name not found in KML date request. URL: ' + req_url)

    # GETCAPABILITIES AND GETTILESERVICE REQUEST TESTS
dataset/ETHPy150Open nasa-gibs/onearth/src/test/test_mod_onearth.py/TestModOnEarth.test_request_date_kml/swapped operands of `in`