Commit e78f3c22 authored by Hilko Bengen's avatar Hilko Bengen

New upstream version 20180501

parent 677fb8ad
language: python language: python
virtualenv:
system_site_packages: true
matrix: matrix:
include: include:
- env: TARGET="pylint" - env: TARGET="pylint"
...@@ -35,11 +37,9 @@ matrix: ...@@ -35,11 +37,9 @@ matrix:
os: osx os: osx
osx_image: xcode9.2 osx_image: xcode9.2
language: generic language: generic
allow_failures:
- env: TARGET="linux-python34"
install: install:
- ./config/travis/install.sh - ./config/travis/install.sh
script: script:
- ./config/travis/runtests.sh - ./config/travis/run_with_timeout.sh 30 ./config/travis/runtests.sh
after_success: after_success:
- if test ${TARGET} = "linux-python27"; then curl -o codecov.sh -s https://codecov.io/bash && /bin/bash ./codecov.sh; fi - if test ${TARGET} = "linux-python27"; then curl -o codecov.sh -s https://codecov.io/bash && /bin/bash ./codecov.sh; fi
...@@ -11,7 +11,14 @@ install: ...@@ -11,7 +11,14 @@ install:
- cmd: "%PYTHON%\\Scripts\\pip.exe install pywin32 WMI" - cmd: "%PYTHON%\\Scripts\\pip.exe install pywin32 WMI"
- cmd: "%PYTHON%\\python.exe %PYTHON%\\Scripts\\pywin32_postinstall.py -install" - cmd: "%PYTHON%\\python.exe %PYTHON%\\Scripts\\pywin32_postinstall.py -install"
- cmd: git clone https://github.com/log2timeline/l2tdevtools.git ..\l2tdevtools - cmd: git clone https://github.com/log2timeline/l2tdevtools.git ..\l2tdevtools
- cmd: mkdir dependencies && set PYTHONPATH=..\l2tdevtools && "%PYTHON%\\python.exe" ..\l2tdevtools\tools\update.py --download-directory dependencies --machine-type x86 --msi-targetdir "%PYTHON%" --track dev funcsigs mock pbr six - cmd: if [%TARGET%]==[python27] (
mkdir dependencies &&
set PYTHONPATH=..\l2tdevtools &&
"%PYTHON%\\python.exe" ..\l2tdevtools\tools\update.py --download-directory dependencies --machine-type x86 --msi-targetdir "%PYTHON%" --track dev funcsigs mock pbr six )
- cmd: if [%TARGET%]==[python36] (
mkdir dependencies &&
set PYTHONPATH=..\l2tdevtools &&
"%PYTHON%\\python.exe" ..\l2tdevtools\tools\update.py --download-directory dependencies --machine-type x86 --msi-targetdir "%PYTHON%" --track dev funcsigs mock pbr six )
build: off build: off
......
dfdatetime (20180324-1) unstable; urgency=low dfdatetime (20180501-1) unstable; urgency=low
* Auto-generated * Auto-generated
-- Log2Timeline <log2timeline-dev@googlegroups.com> Sat, 24 Mar 2018 14:06:11 +0100 -- Log2Timeline <log2timeline-dev@googlegroups.com> Tue, 01 May 2018 17:49:01 +0200
\ No newline at end of file \ No newline at end of file
#!/bin/bash
#
# Script to run commands on a Travis-CI test VM that otherwise would time out
# after 10 minutes. This replaces travis_wait and outputs stdout of the command
# running.
#
# This file is generated by l2tdevtools update-dependencies.py, any dependency
# related changes should be made in dependencies.ini.
# Exit on error.
set -e
# Usage: ./run_with_timeout.sh [TIMEOUT] [COMMAND] [OPTION] [...]
TIMEOUT=$1;
shift
# Launch a command in the background.
$* &
PID_COMMAND=$!;
# Probe the command every minute.
MINUTES=0;
while kill -0 ${PID_COMMAND} >/dev/null 2>&1;
do
# Print to stdout, seeing this prints a space and a backspace
# there is no visible trace.
echo -n -e " \b";
if test ${MINUTES} -ge ${TIMEOUT};
then
kill -9 ${PID_COMMAND} >/dev/null 2>&1;
echo -e "\033[0;31m[ERROR] command: $* timed out after: ${MINUTES} minute(s).\033[0m";
exit 1;
fi
MINUTES=$(( ${MINUTES} + 1 ));
sleep 60;
done
...@@ -12,7 +12,7 @@ if test "${TARGET}" = "pylint"; ...@@ -12,7 +12,7 @@ if test "${TARGET}" = "pylint";
then then
pylint --version pylint --version
for FILE in `find setup.py dfdatetime tests -name \*.py`; for FILE in `find setup.py config dfdatetime tests -name \*.py`;
do do
echo "Checking: ${FILE}"; echo "Checking: ${FILE}";
......
...@@ -5,4 +5,4 @@ dfDateTime, or Digital Forensics date and time, provides date and time ...@@ -5,4 +5,4 @@ dfDateTime, or Digital Forensics date and time, provides date and time
objects to preserve accuracy and precision. objects to preserve accuracy and precision.
""" """
__version__ = '20180324' __version__ = '20180501'
...@@ -107,11 +107,10 @@ class CocoaTime(interface.DateTimeValues): ...@@ -107,11 +107,10 @@ class CocoaTime(interface.DateTimeValues):
"""Copies the Cocoa timestamp to a date and time string. """Copies the Cocoa timestamp to a date and time string.
Returns: Returns:
str: date and time value formatted as: str: date and time value formatted as: YYYY-MM-DD hh:mm:ss.######
YYYY-MM-DD hh:mm:ss.######
""" """
if self._timestamp is None: if self._timestamp is None:
return return None
number_of_days, hours, minutes, seconds = self._GetTimeValues( number_of_days, hours, minutes, seconds = self._GetTimeValues(
int(self._timestamp)) int(self._timestamp))
......
...@@ -114,11 +114,11 @@ class DelphiDateTime(interface.DateTimeValues): ...@@ -114,11 +114,11 @@ class DelphiDateTime(interface.DateTimeValues):
"""Copies the Delphi TDateTime timestamp to a date and time string. """Copies the Delphi TDateTime timestamp to a date and time string.
Returns: Returns:
str: date and time value formatted as: str: date and time value formatted as: "YYYY-MM-DD hh:mm:ss.######" or
YYYY-MM-DD hh:mm:ss.###### None if the timestamp is missing.
""" """
if self._timestamp is None: if self._timestamp is None:
return return None
number_of_seconds = self._timestamp * definitions.SECONDS_PER_DAY number_of_seconds = self._timestamp * definitions.SECONDS_PER_DAY
......
...@@ -84,12 +84,12 @@ class FakeTime(interface.DateTimeValues): ...@@ -84,12 +84,12 @@ class FakeTime(interface.DateTimeValues):
"""Copies the fake timestamp to a date and time string. """Copies the fake timestamp to a date and time string.
Returns: Returns:
str: date and time value formatted as one of the following: str: date and time value formatted as: "YYYY-MM-DD hh:mm:ss" or
YYYY-MM-DD hh:mm:ss "YYYY-MM-DD hh:mm:ss.######" or None if the number of seconds
YYYY-MM-DD hh:mm:ss.###### is missing.
""" """
if self._number_of_seconds is None: if self._number_of_seconds is None:
return return None
number_of_days, hours, minutes, seconds = self._GetTimeValues( number_of_days, hours, minutes, seconds = self._GetTimeValues(
self._number_of_seconds) self._number_of_seconds)
......
...@@ -158,11 +158,11 @@ class FATDateTime(interface.DateTimeValues): ...@@ -158,11 +158,11 @@ class FATDateTime(interface.DateTimeValues):
"""Copies the FAT date time to a date and time string. """Copies the FAT date time to a date and time string.
Returns: Returns:
str: date and time value formatted as: str: date and time value formatted as: "YYYY-MM-DD hh:mm:ss" or None
YYYY-MM-DD hh:mm:ss if number of seconds is missing.
""" """
if self._number_of_seconds is None: if self._number_of_seconds is None:
return return None
number_of_days, hours, minutes, seconds = self._GetTimeValues( number_of_days, hours, minutes, seconds = self._GetTimeValues(
self._number_of_seconds) self._number_of_seconds)
......
...@@ -110,12 +110,12 @@ class Filetime(interface.DateTimeValues): ...@@ -110,12 +110,12 @@ class Filetime(interface.DateTimeValues):
"""Copies the FILETIME timestamp to a date and time string. """Copies the FILETIME timestamp to a date and time string.
Returns: Returns:
str: date and time value formatted as: str: date and time value formatted as: "YYYY-MM-DD hh:mm:ss.#######" or
YYYY-MM-DD hh:mm:ss.####### None if the timestamp is missing or invalid.
""" """
if (self._timestamp is None or self._timestamp < 0 or if (self._timestamp is None or self._timestamp < 0 or
self._timestamp > self._UINT64_MAX): self._timestamp > self._UINT64_MAX):
return return None
timestamp, remainder = divmod(self._timestamp, self._100NS_PER_SECOND) timestamp, remainder = divmod(self._timestamp, self._100NS_PER_SECOND)
number_of_days, hours, minutes, seconds = self._GetTimeValues(timestamp) number_of_days, hours, minutes, seconds = self._GetTimeValues(timestamp)
......
...@@ -102,12 +102,12 @@ class HFSTime(interface.DateTimeValues): ...@@ -102,12 +102,12 @@ class HFSTime(interface.DateTimeValues):
"""Copies the HFS timestamp to a date and time string. """Copies the HFS timestamp to a date and time string.
Returns: Returns:
str: date and time value formatted as: str: date and time value formatted as: "YYYY-MM-DD hh:mm:ss" or None
YYYY-MM-DD hh:mm:ss if the timestamp is missing or invalid.
""" """
if (self._timestamp is None or self._timestamp < 0 or if (self._timestamp is None or self._timestamp < 0 or
self._timestamp > self._UINT32_MAX): self._timestamp > self._UINT32_MAX):
return return None
number_of_days, hours, minutes, seconds = self._GetTimeValues( number_of_days, hours, minutes, seconds = self._GetTimeValues(
self._timestamp) self._timestamp)
......
...@@ -77,12 +77,9 @@ class DateTimeValues(object): ...@@ -77,12 +77,9 @@ class DateTimeValues(object):
Returns: Returns:
bool: True if the date time values are equal to other. bool: True if the date time values are equal to other.
Raises:
ValueError: if other is not an instance of DateTimeValues.
""" """
if not isinstance(other, DateTimeValues): if not isinstance(other, DateTimeValues):
raise ValueError('Other not an instance of DateTimeValues') return False
normalized_timestamp = self._GetNormalizedTimestamp() normalized_timestamp = self._GetNormalizedTimestamp()
other_normalized_timestamp = other._GetNormalizedTimestamp() # pylint: disable=protected-access other_normalized_timestamp = other._GetNormalizedTimestamp() # pylint: disable=protected-access
...@@ -207,12 +204,9 @@ class DateTimeValues(object): ...@@ -207,12 +204,9 @@ class DateTimeValues(object):
Returns: Returns:
bool: True if the date time values are not equal to other. bool: True if the date time values are not equal to other.
Raises:
ValueError: if other is not an instance of DateTimeValues.
""" """
if not isinstance(other, DateTimeValues): if not isinstance(other, DateTimeValues):
raise ValueError('Other not an instance of DateTimeValues') return True
normalized_timestamp = self._GetNormalizedTimestamp() normalized_timestamp = self._GetNormalizedTimestamp()
other_normalized_timestamp = other._GetNormalizedTimestamp() # pylint: disable=protected-access other_normalized_timestamp = other._GetNormalizedTimestamp() # pylint: disable=protected-access
...@@ -862,8 +856,7 @@ class DateTimeValues(object): ...@@ -862,8 +856,7 @@ class DateTimeValues(object):
"""Copies the date time value to a date and time string. """Copies the date time value to a date and time string.
Returns: Returns:
str: date and time value formatted as: str: date and time value formatted as: "YYYY-MM-DD hh:mm:ss.######"
YYYY-MM-DD hh:mm:ss.######
""" """
@abc.abstractmethod @abc.abstractmethod
......
...@@ -98,12 +98,12 @@ class JavaTime(interface.DateTimeValues): ...@@ -98,12 +98,12 @@ class JavaTime(interface.DateTimeValues):
"""Copies the Java timestamp to a date and time string. """Copies the Java timestamp to a date and time string.
Returns: Returns:
str: date and time value formatted as: str: date and time value formatted as: "YYYY-MM-DD hh:mm:ss.###" or
YYYY-MM-DD hh:mm:ss.### None if the timestamp is missing or invalid.
""" """
if (self._timestamp is None or self._timestamp < self._INT64_MIN or if (self._timestamp is None or self._timestamp < self._INT64_MIN or
self._timestamp > self._INT64_MAX): self._timestamp > self._INT64_MAX):
return return None
timestamp, milliseconds = divmod( timestamp, milliseconds = divmod(
self._timestamp, definitions.MILLISECONDS_PER_SECOND) self._timestamp, definitions.MILLISECONDS_PER_SECOND)
......
...@@ -112,11 +112,11 @@ class OLEAutomationDate(interface.DateTimeValues): ...@@ -112,11 +112,11 @@ class OLEAutomationDate(interface.DateTimeValues):
"""Copies the OLE Automation date to a date and time string. """Copies the OLE Automation date to a date and time string.
Returns: Returns:
str: date and time value formatted as: str: date and time value formatted as: "YYYY-MM-DD hh:mm:ss.######" or
YYYY-MM-DD hh:mm:ss.###### None if the timestamp is missing.
""" """
if self._timestamp is None: if self._timestamp is None:
return return None
timestamp = self._timestamp * definitions.SECONDS_PER_DAY timestamp = self._timestamp * definitions.SECONDS_PER_DAY
......
...@@ -193,11 +193,11 @@ class RFC2579DateTime(interface.DateTimeValues): ...@@ -193,11 +193,11 @@ class RFC2579DateTime(interface.DateTimeValues):
"""Copies the RFC2579 date-time to a date and time string. """Copies the RFC2579 date-time to a date and time string.
Returns: Returns:
str: date and time value formatted as: str: date and time value formatted as: "YYYY-MM-DD hh:mm:ss.#" or
YYYY-MM-DD hh:mm:ss.# None if the number of seconds is missing.
""" """
if self._number_of_seconds is None: if self._number_of_seconds is None:
return return None
return '{0:04d}-{1:02d}-{2:02d} {3:02d}:{4:02d}:{5:02d}.{6:01d}'.format( return '{0:04d}-{1:02d}-{2:02d} {3:02d}:{4:02d}:{5:02d}.{6:01d}'.format(
self.year, self.month, self.day_of_month, self.hours, self.minutes, self.year, self.month, self.day_of_month, self.hours, self.minutes,
......
...@@ -41,13 +41,7 @@ class SemanticTime(interface.DateTimeValues): ...@@ -41,13 +41,7 @@ class SemanticTime(interface.DateTimeValues):
Returns: Returns:
bool: True if the date time values are equal to other. bool: True if the date time values are equal to other.
Raises:
ValueError: if other is not an instance of DateTimeValues.
""" """
if not isinstance(other, interface.DateTimeValues):
raise ValueError('Other not an instance of DateTimeValues')
if not isinstance(other, SemanticTime): if not isinstance(other, SemanticTime):
return False return False
...@@ -141,13 +135,7 @@ class SemanticTime(interface.DateTimeValues): ...@@ -141,13 +135,7 @@ class SemanticTime(interface.DateTimeValues):
Returns: Returns:
bool: True if the date time values are not equal to other. bool: True if the date time values are not equal to other.
Raises:
ValueError: if other is not an instance of DateTimeValues.
""" """
if not isinstance(other, interface.DateTimeValues):
raise ValueError('Other not an instance of DateTimeValues')
if not isinstance(other, SemanticTime): if not isinstance(other, SemanticTime):
return True return True
...@@ -238,13 +226,7 @@ class Never(SemanticTime): ...@@ -238,13 +226,7 @@ class Never(SemanticTime):
Returns: Returns:
bool: True if the date time values are equal to other. bool: True if the date time values are equal to other.
Raises:
ValueError: if other is not an instance of DateTimeValues.
""" """
if not isinstance(other, interface.DateTimeValues):
raise ValueError('Other not an instance of DateTimeValues')
return isinstance(other, Never) return isinstance(other, Never)
def __ge__(self, other): def __ge__(self, other):
...@@ -323,13 +305,7 @@ class Never(SemanticTime): ...@@ -323,13 +305,7 @@ class Never(SemanticTime):
Returns: Returns:
bool: True if the date time values are not equal to other. bool: True if the date time values are not equal to other.
Raises:
ValueError: if other is not an instance of DateTimeValues.
""" """
if not isinstance(other, interface.DateTimeValues):
raise ValueError('Other not an instance of DateTimeValues')
return not isinstance(other, Never) return not isinstance(other, Never)
......
...@@ -175,11 +175,11 @@ class Systemtime(interface.DateTimeValues): ...@@ -175,11 +175,11 @@ class Systemtime(interface.DateTimeValues):
"""Copies the SYSTEMTIME structure to a date and time string. """Copies the SYSTEMTIME structure to a date and time string.
Returns: Returns:
str: date and time value formatted as: str: date and time value formatted as: "YYYY-MM-DD hh:mm:ss.###" or
YYYY-MM-DD hh:mm:ss.### None if the number of seconds is missing.
""" """
if self._number_of_seconds is None: if self._number_of_seconds is None:
return return None
return '{0:04d}-{1:02d}-{2:02d} {3:02d}:{4:02d}:{5:02d}.{6:03d}'.format( return '{0:04d}-{1:02d}-{2:02d} {3:02d}:{4:02d}:{5:02d}.{6:03d}'.format(
self.year, self.month, self.day_of_month, self.hours, self.minutes, self.year, self.month, self.day_of_month, self.hours, self.minutes,
......
...@@ -115,12 +115,12 @@ class UUIDTime(interface.DateTimeValues): ...@@ -115,12 +115,12 @@ class UUIDTime(interface.DateTimeValues):
"""Copies the UUID timestamp to a date and time string. """Copies the UUID timestamp to a date and time string.
Returns: Returns:
str: date and time value formatted as: str: date and time value formatted as: "YYYY-MM-DD hh:mm:ss.#######" or
YYYY-MM-DD hh:mm:ss.####### None if the timestamp is missing or invalid.
""" """
if (self._timestamp is None or self._timestamp < 0 or if (self._timestamp is None or self._timestamp < 0 or
self._timestamp > self._UINT60_MAX): self._timestamp > self._UINT60_MAX):
return return None
timestamp, remainder = divmod(self._timestamp, self._100NS_PER_SECOND) timestamp, remainder = divmod(self._timestamp, self._100NS_PER_SECOND)
number_of_days, hours, minutes, seconds = self._GetTimeValues(timestamp) number_of_days, hours, minutes, seconds = self._GetTimeValues(timestamp)
......
...@@ -103,12 +103,12 @@ class WebKitTime(interface.DateTimeValues): ...@@ -103,12 +103,12 @@ class WebKitTime(interface.DateTimeValues):
"""Copies the WebKit timestamp to a date and time string. """Copies the WebKit timestamp to a date and time string.
Returns: Returns:
str: date and time value formatted as: str: date and time value formatted as: "YYYY-MM-DD hh:mm:ss.######" or
YYYY-MM-DD hh:mm:ss.###### None if the timestamp is missing or invalid.
""" """
if (self._timestamp is None or self._timestamp < self._INT64_MIN or if (self._timestamp is None or self._timestamp < self._INT64_MIN or
self._timestamp > self._INT64_MAX): self._timestamp > self._INT64_MAX):
return return None
timestamp, microseconds = divmod( timestamp, microseconds = divmod(
self._timestamp, definitions.MICROSECONDS_PER_SECOND) self._timestamp, definitions.MICROSECONDS_PER_SECOND)
......
...@@ -94,14 +94,13 @@ else: ...@@ -94,14 +94,13 @@ else:
'%files -n {0:s}-%{{name}}'.format(python_package), '%files -n {0:s}-%{{name}}'.format(python_package),
'%defattr(644,root,root,755)', '%defattr(644,root,root,755)',
'%doc ACKNOWLEDGEMENTS AUTHORS LICENSE README', '%doc ACKNOWLEDGEMENTS AUTHORS LICENSE README',
'%{_prefix}/lib/python*/site-packages/dfdatetime/*.py', '%{_prefix}/lib/python*/site-packages/**/*.py',
'%{_prefix}/lib/python*/site-packages/dfdatetime*.egg-info/*', '%{_prefix}/lib/python*/site-packages/dfdatetime*.egg-info/*',
'', '',
'%exclude %{_prefix}/share/doc/*', '%exclude %{_prefix}/share/doc/*',
'%exclude %{_prefix}/lib/python*/site-packages/dfdatetime/*.pyc', '%exclude %{_prefix}/lib/python*/site-packages/**/*.pyc',
'%exclude %{_prefix}/lib/python*/site-packages/dfdatetime/*.pyo', '%exclude %{_prefix}/lib/python*/site-packages/**/*.pyo',
('%exclude %{_prefix}/lib/python*/site-packages/dfdatetime/' '%exclude %{_prefix}/lib/python*/site-packages/**/__pycache__/*']
'__pycache__/*')]
python_spec_file.extend(lines) python_spec_file.extend(lines)
break break
...@@ -130,7 +129,7 @@ else: ...@@ -130,7 +129,7 @@ else:
dfdatetime_description = ( dfdatetime_description = (
'Digital Forensics Date and Time (dfDateTime).') 'Digital Forensics date and time (dfDateTime).')
dfdatetime_long_description = ( dfdatetime_long_description = (
'dfDateTime, or Digital Forensics date and time, provides date and time ' 'dfDateTime, or Digital Forensics date and time, provides date and time '
......
...@@ -97,8 +97,7 @@ class DateTimeValuesTest(unittest.TestCase): ...@@ -97,8 +97,7 @@ class DateTimeValuesTest(unittest.TestCase):
self.assertFalse(date_time_values1 < date_time_values2) self.assertFalse(date_time_values1 < date_time_values2)
self.assertFalse(date_time_values1 != date_time_values2) self.assertFalse(date_time_values1 != date_time_values2)
with self.assertRaises(ValueError): self.assertFalse(date_time_values1 == 0.0)
date_time_values1 == 0.0 # pylint: disable=pointless-statement
with self.assertRaises(ValueError): with self.assertRaises(ValueError):
date_time_values1 >= 0.0 # pylint: disable=pointless-statement date_time_values1 >= 0.0 # pylint: disable=pointless-statement
...@@ -112,8 +111,7 @@ class DateTimeValuesTest(unittest.TestCase): ...@@ -112,8 +111,7 @@ class DateTimeValuesTest(unittest.TestCase):
with self.assertRaises(ValueError): with self.assertRaises(ValueError):
date_time_values1 < 0.0 # pylint: disable=pointless-statement date_time_values1 < 0.0 # pylint: disable=pointless-statement
with self.assertRaises(ValueError): self.assertTrue(date_time_values1 != 0.0)
date_time_values1 != 0.0 # pylint: disable=pointless-statement
# TODO: add tests for _AdjustForTimeZoneOffset. # TODO: add tests for _AdjustForTimeZoneOffset.
......
...@@ -50,8 +50,7 @@ class SemanticTimeTest(unittest.TestCase): ...@@ -50,8 +50,7 @@ class SemanticTimeTest(unittest.TestCase):
self.assertTrue(semantic_time_object1 < date_time_values1) self.assertTrue(semantic_time_object1 < date_time_values1)
self.assertTrue(semantic_time_object1 != date_time_values1) self.assertTrue(semantic_time_object1 != date_time_values1)
with self.assertRaises(ValueError): self.assertFalse(semantic_time_object1 == 0.0)
semantic_time_object1 == 0.0 # pylint: disable=pointless-statement
with self.assertRaises(ValueError): with self.assertRaises(ValueError):
semantic_time_object1 >= 0.0 # pylint: disable=pointless-statement semantic_time_object1 >= 0.0 # pylint: disable=pointless-statement
...@@ -65,8 +64,7 @@ class SemanticTimeTest(unittest.TestCase): ...@@ -65,8 +64,7 @@ class SemanticTimeTest(unittest.TestCase):
with self.assertRaises(ValueError): with self.assertRaises(ValueError):
semantic_time_object1 < 0.0 # pylint: disable=pointless-statement semantic_time_object1 < 0.0 # pylint: disable=pointless-statement
with self.assertRaises(ValueError): self.assertTrue(semantic_time_object1 != 0.0)
semantic_time_object1 != 0.0 # pylint: disable=pointless-statement
def testCopyFromDateTimeString(self): def testCopyFromDateTimeString(self):
"""Tests the CopyFromDateTimeString function.""" """Tests the CopyFromDateTimeString function."""
...@@ -155,8 +153,7 @@ class NeverTest(unittest.TestCase): ...@@ -155,8 +153,7 @@ class NeverTest(unittest.TestCase):
self.assertFalse(never_time_object1 < date_time_values1) self.assertFalse(never_time_object1 < date_time_values1)
self.assertTrue(never_time_object1 != date_time_values1) self.assertTrue(never_time_object1 != date_time_values1)
with self.assertRaises(ValueError): self.assertFalse(never_time_object1 == 0.0)
never_time_object1 == 0.0 # pylint: disable=pointless-statement
with self.assertRaises(ValueError): with self.assertRaises(ValueError):
never_time_object1 >= 0.0 # pylint: disable=pointless-statement never_time_object1 >= 0.0 # pylint: disable=pointless-statement
...@@ -170,8 +167,7 @@ class NeverTest(unittest.TestCase): ...@@ -170,8 +167,7 @@ class NeverTest(unittest.TestCase):
with self.assertRaises(ValueError): with self.assertRaises(ValueError):
never_time_object1 < 0.0 # pylint: disable=pointless-statement never_time_object1 < 0.0 # pylint: disable=pointless-statement
with self.assertRaises(ValueError): self.assertTrue(never_time_object1 != 0.0)
never_time_object1 != 0.0 # pylint: disable=pointless-statement
class NotSetTest(unittest.TestCase): class NotSetTest(unittest.TestCase):
......
...@@ -76,7 +76,7 @@ class DependencyDefinitionReader(object): ...@@ -76,7 +76,7 @@ class DependencyDefinitionReader(object):
try: try:
return config_parser.get(section_name, value_name) return config_parser.get(section_name, value_name)
except configparser.NoOptionError: except configparser.NoOptionError:
return return None
def Read(self, file_object): def Read(self, file_object):
"""Reads dependency definitions. """Reads dependency definitions.
...@@ -287,7 +287,7 @@ class DependencyHelper(object): ...@@ -287,7 +287,7 @@ class DependencyHelper(object):
try: try:
module_object = list(map(__import__, [module_name]))[0] module_object = list(map(__import__, [module_name]))[0]
except ImportError: except ImportError:
return return None
# If the module name contains dots get the upper most module object. # If the module name contains dots get the upper most module object.
if '.' in module_name: if '.' in module_name:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment