From c17b9402f7928ca774cd56ccd45042e877ba3eae Mon Sep 17 00:00:00 2001 From: Terrtia Date: Fri, 4 May 2018 14:25:47 +0200 Subject: [PATCH] clean --- bin/ModulesInformationV2.py | 4 ---- tests/testHelper.py | 2 +- tests/testKeys.py | 10 ++++++++-- .../modules/trendingmodules/Flask_trendingmodules.py | 2 +- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/bin/ModulesInformationV2.py b/bin/ModulesInformationV2.py index c39e51b2..36b397ca 100755 --- a/bin/ModulesInformationV2.py +++ b/bin/ModulesInformationV2.py @@ -723,10 +723,6 @@ def format_string(tab, padding_row): text="" for ite, elem in enumerate(the_array): - try: - elem = elem.decode('utf8') - except AttributeError: - pass if len(elem) > padding_row[ite]: text += "*" + elem[-padding_row[ite]+6:] diff --git a/tests/testHelper.py b/tests/testHelper.py index 251eef1a..7b1e07a3 100644 --- a/tests/testHelper.py +++ b/tests/testHelper.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- coding: utf-8 -*- import unittest diff --git a/tests/testKeys.py b/tests/testKeys.py index 70fe4275..9dc45c75 100644 --- a/tests/testKeys.py +++ b/tests/testKeys.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- coding: utf-8 -*- import sys,os @@ -10,7 +10,7 @@ sys.path.append(os.environ['AIL_BIN']) from packages.Paste import Paste import Keys as Keys from Helper import Process -import pubsublogger +from pubsublogger import publisher class TestKeysModule(unittest.TestCase): @@ -28,3 +28,9 @@ class TestKeysModule(unittest.TestCase): def test_search_key(self): with self.assertRaises(pubsublogger.exceptions.NoChannelError): Keys.search_key(self.paste) + + def test_search_key(self): + with self.assertRaises(NameError): + publisher.port = 6380 + publisher.channel = 'Script' + Keys.search_key(self.paste) diff --git a/var/www/modules/trendingmodules/Flask_trendingmodules.py b/var/www/modules/trendingmodules/Flask_trendingmodules.py index eca5e606..373d08bc 100644 --- a/var/www/modules/trendingmodules/Flask_trendingmodules.py +++ b/var/www/modules/trendingmodules/Flask_trendingmodules.py @@ -115,7 +115,7 @@ def providersChart(): # Member set is a list of (value, score) pairs if len(member_set) == 0: - member_set_str.append(("No relevant data", float(100))) + member_set.append(("No relevant data", float(100))) return jsonify(member_set)