From de297a5cc02b418f5351852f55bfbf4363bbe317 Mon Sep 17 00:00:00 2001 From: eagle00789 Date: Mon, 1 Jun 2015 14:41:50 +0200 Subject: [PATCH 1/2] MiniProbe print replaced by logging, added start og miniprobe unittests --- miniprobe/miniprobe.py | 2 +- miniprobe/tests/test_miniprobe.py | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 miniprobe/tests/test_miniprobe.py diff --git a/miniprobe/miniprobe.py b/miniprobe/miniprobe.py index 809302b..f89c66c 100644 --- a/miniprobe/miniprobe.py +++ b/miniprobe/miniprobe.py @@ -65,7 +65,7 @@ def get_import_sensors(self): try: sensor_objects.append(self.load_class("sensors.%s.%s" % (mod.lower(), mod))) except Exception as import_error: - print import_error + logging.error("Sensor Import Error! Error message: %s" % import_error) return sensor_objects @staticmethod diff --git a/miniprobe/tests/test_miniprobe.py b/miniprobe/tests/test_miniprobe.py new file mode 100644 index 0000000..643a944 --- /dev/null +++ b/miniprobe/tests/test_miniprobe.py @@ -0,0 +1,10 @@ +#!/usr/bin/env python + +from nose.tools import * +from miniprobe import miniprobe + +def test_miniprobe_hash_access_key(): + """miniprobe returns the correct hash_access_key""" + test_hash_access_key = miniprobe.MiniProbe() + assert_equal(test_hash_access_key.hash_access_key('test'), 'a94a8fe5ccb19ba61c4c0873d391e987982fbbd3') + From 9d45459e3fe97b12298f685a8fbb879a17a90a82 Mon Sep 17 00:00:00 2001 From: eagle00789 Date: Mon, 1 Jun 2015 14:44:48 +0200 Subject: [PATCH 2/2] removed travis-ci python 2.6 as we now require a minimum of python 2.7 --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index b2ef446..f2822ff 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,5 @@ language: python python: - - "2.6" - "2.7" - "3.2" - "3.3"