Skip to content
This repository has been archived by the owner on Jun 7, 2018. It is now read-only.

Commit

Permalink
minor bug in QueryThread test case fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
rc0r committed Jan 11, 2015
1 parent cc86460 commit 8c83d39
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 6 deletions.
6 changes: 2 additions & 4 deletions AvivoreXT/Avivore.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,8 @@ def process_tweet(self, string):
if self.__db_dup_check(string[3], string[2]) == 0:
self.__db_write_value(time.time(), string[0], string[1], string[5],
string[2], string[3], string[4])
return "Type: " + str(string[0]) + ", User: " + string[1] + " (" + \
string[5] + "), Content: " + string[2] + ", TID: " + str(string[3])
else:
return 0
return 'Type: %s, User: %s (%s), Content: %s, TID: %s' % (str(string[0]), string[1], string[5], string[2],
str(string[3]))

"""
Database related functions
Expand Down
2 changes: 1 addition & 1 deletion AvivoreXT/QueryThread.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def extract_data_from_tweet(self, avivore, tweet):
# result value, time, result itself, tweet ID, tweet itself, userId
string = result[0], z[2], result[1], z[0], z[3], z[4]
message = avivore.process_tweet(string)
if 0 != message:
if message is not None:
Helper.output("[Q] " + message)

def twitter_search(self, avivore):
Expand Down
Binary file modified sample_conf.db
Binary file not shown.
3 changes: 2 additions & 1 deletion test/test_QueryThread.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
import unittest
from AvivoreXT import Avivore, QueryThread, AvivoreTwitterError
import os
import shutil


class QueryThreadTestCase(unittest.TestCase):
def setUp(self):
# code to execute in preparation for tests
os.symlink('../sample_conf.db', './testdata/test.db')
shutil.copyfile('./sample_conf.db', './testdata/test.db')

self.avivore_conf = Avivore.AvivoreConfig.AvivoreConfig(1, './testdata/test.db')
self.avivore_conf.read_config()
Expand Down
Binary file modified testdata/empty_typedefs.db
Binary file not shown.

0 comments on commit 8c83d39

Please sign in to comment.