Skip to content
Permalink
Browse files

Try to fix time comparison issue on Travis

  • Loading branch information
nyalldawson committed May 7, 2020
1 parent d08a4c1 commit eda1d70c156550445bc1cd89bb67006ebf0cdbf8
Showing with 6 additions and 6 deletions.
  1. +1 −1 src/providers/arcgisrest/qgsarcgisrestutils.cpp
  2. +5 −5 tests/src/python/test_provider_afs.py
@@ -1070,7 +1070,7 @@ QDateTime QgsArcGisRestUtils::parseDateTime( const QVariant &value )
if ( value.isNull() )
return QDateTime();
bool ok = false;
QDateTime dt = QDateTime::fromMSecsSinceEpoch( value.toLongLong( &ok ) );
QDateTime dt = QDateTime::fromMSecsSinceEpoch( value.toLongLong( &ok ), Qt::UTC );
if ( !ok )
{
QgsDebugMsg( QStringLiteral( "Invalid value %1 for datetime" ).arg( value.toString() ) );
@@ -16,7 +16,7 @@
import tempfile
import shutil

from qgis.PyQt.QtCore import QCoreApplication, Qt, QObject, QDate, QDateTime
from qgis.PyQt.QtCore import QCoreApplication, Qt, QObject, QDate, QDateTime, QTime

from qgis.core import (NULL,
QgsVectorLayer,
@@ -984,8 +984,8 @@ def testTemporal1(self):
self.assertEqual(vl.dataProvider().temporalCapabilities().startField(), 'date_start')
self.assertFalse(vl.dataProvider().temporalCapabilities().endField())
self.assertEqual(vl.dataProvider().temporalCapabilities().mode(), QgsVectorDataProviderTemporalCapabilities.ProviderStoresFeatureDateTimeInstantInField)
self.assertEqual(vl.dataProvider().temporalCapabilities().availableTemporalRange().begin(), QDateTime(2006, 3, 11, 0, 13, 20))
self.assertEqual(vl.dataProvider().temporalCapabilities().availableTemporalRange().end(), QDateTime(2017, 2, 14, 1, 33, 20))
self.assertEqual(vl.dataProvider().temporalCapabilities().availableTemporalRange().begin(), QDateTime(QDate(2006, 3, 10), QTime(14, 13, 20), Qt.UTC))
self.assertEqual(vl.dataProvider().temporalCapabilities().availableTemporalRange().end(), QDateTime(QDate(2017, 2, 13), QTime(15, 33, 20), Qt.UTC))

def testTemporal2(self):
"""
@@ -1039,8 +1039,8 @@ def testTemporal2(self):
self.assertEqual(vl.dataProvider().temporalCapabilities().startField(), 'date_start')
self.assertEqual(vl.dataProvider().temporalCapabilities().endField(), 'date_end')
self.assertEqual(vl.dataProvider().temporalCapabilities().mode(), QgsVectorDataProviderTemporalCapabilities.ProviderStoresFeatureDateTimeStartAndEndInSeparateFields)
self.assertEqual(vl.dataProvider().temporalCapabilities().availableTemporalRange().begin(), QDateTime(2006, 3, 11, 0, 13, 20))
self.assertEqual(vl.dataProvider().temporalCapabilities().availableTemporalRange().end(), QDateTime(2017, 2, 14, 1, 33, 20))
self.assertEqual(vl.dataProvider().temporalCapabilities().availableTemporalRange().begin(), QDateTime(QDate(2006, 3, 10), QTime(14, 13, 20), Qt.UTC))
self.assertEqual(vl.dataProvider().temporalCapabilities().availableTemporalRange().end(), QDateTime(QDate(2017, 2, 13), QTime(15, 33, 20), Qt.UTC))

def testImageServer(self):
"""

0 comments on commit eda1d70

Please sign in to comment.
You can’t perform that action at this time.