Skip to content

Commit

Permalink
new: dev: preparing release @Release
Browse files Browse the repository at this point in the history
  • Loading branch information
geonexus committed Mar 16, 2015
1 parent 7ff5862 commit 8771ad9
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion facts/mylist.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def __add__(self, other):

limit = len(self.data) - 1

for i in range(0, limit):
for i in range(1, limit):
result.data[i] = self.data[i] + other.data[i]

result.data[limit] = other.data[limit]
Expand Down
5 changes: 4 additions & 1 deletion server.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
# contact with opensource@tid.es
#

__version__ = '1.0.0'
__version__ = '1.1.0'
__version_info__ = tuple([int(num) for num in __version__.split('.')])
__description__ = 'Facts Listener'
__author__ = 'fla'
Expand Down Expand Up @@ -162,6 +162,9 @@ def process_request(request, tenantid, serverid):
# fix the last value with the current date and time
data.insert(3, datetime.datetime.today().isoformat())

# Check data coherency of time stamps
mredis.check_time_stamps()

# Insert the result into the queue system
mredis.insert(tenantid, serverid, data)
logging.info(data)
Expand Down
10 changes: 5 additions & 5 deletions tests/test_mylist.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,9 @@ def testinit(self):

def testsum(self):
"""check the sum of list"""
p1 = [[1, 2, 3], [1, 2, 4], [1, 2, 5]]
p1 = [['serverId', 1, 2, 3], ['serverId', 1, 2, 4], ['serverId', 1, 2, 5]]

expectedvalue = [3, 6, 5]
expectedvalue = ['serverId', 3, 6, 5]

result = mylist.sum(p1)

Expand Down Expand Up @@ -136,7 +136,7 @@ def testdivlistFloat(self):
def testmedia(self):
"""check the media of a list of data"""

expectedvalue = ['serverIdserverIdserverIdserverId', 7, 8, 18]
expectedvalue = ['serverId', 7, 8, 18]

p1 = [['serverId', 1, 2, 3], ['serverId', 5, 6, 7], ['serverId', 9, 10, 11], ['serverId', 13, 14, 18]]

Expand All @@ -148,7 +148,7 @@ def testsum2(self):
"""check the sum of a list of strings but with commas"""
p1 = ['[serverId, 1, 2, 1]', '[serverId, 1, 2, 2]', '[serverId, 1, 2, 3]', '[serverId, 1, 2, 4]']

expectedvalue = ['serverIdserverIdserverIdserverId', 4.0, 8.0, '4']
expectedvalue = ['serverId', 4.0, 8.0, '4']

result = mylist.sum(p1)

Expand Down Expand Up @@ -212,7 +212,7 @@ def testReadMedia1Data(self):
"""test the insertion of a real data and calculate its media"""

fact = ['serverId', 1.0, 0.14, '2014-03-29T23:02:46.973949']
expectedvalue = ['serverIdserverId', 1.0, 0.14, '2014-03-29T23:02:46.973949']
expectedvalue = ['serverId', 1.0, 0.14, '2014-03-29T23:02:46.973949']

p2 = list()

Expand Down
1 change: 1 addition & 0 deletions tests/test_redis.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ def testRealData2(self):
p.insert(serverid, tenantid, p2)
p.insert(serverid, tenantid, p2)


result = p.media(p.range(serverid, tenantid))

self.assertEqual(expected, result.data)

0 comments on commit 8771ad9

Please sign in to comment.