|
|
@ -1,13 +1,11 @@ |
|
|
|
from json import dumps |
|
|
|
|
|
|
|
from random import randint |
|
|
|
|
|
|
|
from time import time |
|
|
|
from uuid import uuid4 |
|
|
|
|
|
|
|
def comment(author, title, text, t): |
|
|
|
def comment(author, title, text, t, uid): |
|
|
|
return { |
|
|
|
"time" : t, |
|
|
|
"id" : randint(1,2**32-1), |
|
|
|
"id" : uid, |
|
|
|
"title" : title, |
|
|
|
"author" : author, |
|
|
|
"text" : text |
|
|
@ -17,14 +15,14 @@ def comment(author, title, text, t): |
|
|
|
testcomments = { |
|
|
|
1 : dumps( |
|
|
|
[ |
|
|
|
comment("Person 1", "Two", "A Comment here", 1), |
|
|
|
comment("Person 2", "One", "Some other comment", 2), |
|
|
|
comment("Person 3", "Three", "My opinion is correct", 3) |
|
|
|
comment("Person 1", "Two", "A Comment here", 1, str(uuid4())), |
|
|
|
comment("Person 2", "One", "Some other comment", 2, str(uuid4())), |
|
|
|
comment("Person 3", "Three", "My opinion is correct", 3, str(uuid4())) |
|
|
|
]), |
|
|
|
2 : dumps( |
|
|
|
[ |
|
|
|
comment("Person 1", "Two", "A cool terrible Comment here", 1), |
|
|
|
comment("Person 2", "One", "Some other awful comment", 2), |
|
|
|
comment("Person 3", "Three", "My opinion is not correct", 3) |
|
|
|
comment("Person 1", "Two", "A cool terrible Comment here", 1, str(uuid4())), |
|
|
|
comment("Person 2", "One", "Some other awful comment", 2, str(uuid4())), |
|
|
|
comment("Person 3", "Three", "My opinion is not correct", 3, str(uuid4())) |
|
|
|
]) |
|
|
|
} |
|
|
|