summaryrefslogtreecommitdiff
path: root/src/test/libical-glib/misc.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/libical-glib/misc.py')
-rw-r--r--[-rwxr-xr-x]src/test/libical-glib/misc.py31
1 files changed, 11 insertions, 20 deletions
diff --git a/src/test/libical-glib/misc.py b/src/test/libical-glib/misc.py
index d10648b8..8bfc2072 100755..100644
--- a/src/test/libical-glib/misc.py
+++ b/src/test/libical-glib/misc.py
@@ -1,28 +1,19 @@
#!/usr/bin/env python3
-#GI_TYPELIB_PATH=$PREFIX/lib/girepository-1.0/ ./misc.py
+# GI_TYPELIB_PATH=$PREFIX/lib/girepository-1.0/ ./misc.py
###############################################################################
#
-# Copyright (C) 2019 Red Hat Inc. <www.redhat.com>
+# SPDX-FileCopyrightText: 2019 Red Hat Inc. <www.redhat.com>
#
-# This library is free software; you can redistribute it and/or modify
-# it under the terms of either:
-#
-# The LGPL as published by the Free Software Foundation, version
-# 2.1, available at: https://www.gnu.org/licenses/lgpl-2.1.txt
-#
-# Or:
-#
-# The Mozilla Public License Version 2.0. You may obtain a copy of
-# the License at https://www.mozilla.org/MPL/
+# SPDX-License-Identifier: LGPL-2.1-only OR MPL-2.0
#
###############################################################################
-import gi
+''' Test Python bindings for libical miscellaneous types '''
+import gi
gi.require_version('ICalGLib', '3.0')
-
-from gi.repository import ICalGLib
+from gi.repository import ICalGLib # nopep8 # pylint: disable=wrong-import-position
geo = ICalGLib.Geo.new(10.0, 20.0)
assert geo.get_lat() == 10.0
@@ -31,21 +22,21 @@ geo_clone = geo.clone()
assert geo.get_lat() == geo_clone.get_lat()
assert geo.get_lon() == geo_clone.get_lon()
geo_clone.set_lat(30.0)
-geo_clone.set_lon(40.0);
+geo_clone.set_lon(40.0)
assert geo_clone.get_lat() == 30.0
assert geo_clone.get_lon() == 40.0
assert geo.get_lat() != geo_clone.get_lat()
assert geo.get_lon() != geo_clone.get_lon()
-start = ICalGLib.Time.new_from_string("20190130T111213Z");
+start = ICalGLib.Time.new_from_string("20190130T111213Z")
end = ICalGLib.Time.new_from_string("20190203T100908Z")
-span = ICalGLib.TimeSpan.new(start, end, 0);
+span = ICalGLib.TimeSpan.new(start, end, 0)
assert span.get_start() == start.as_timet()
assert span.get_end() == end.as_timet()
assert span.get_is_busy() == 0
-start = ICalGLib.Time.new_from_string("20190330T131415Z");
+start = ICalGLib.Time.new_from_string("20190330T131415Z")
end = ICalGLib.Time.new_from_string("20190403T070605Z")
-span = ICalGLib.TimeSpan.new(start, end, 1);
+span = ICalGLib.TimeSpan.new(start, end, 1)
assert span.get_start() == start.as_timet()
assert span.get_end() == end.as_timet()
assert span.get_is_busy() == 1