-
Notifications
You must be signed in to change notification settings - Fork 572
Added mock code #1883
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: v0.6
Are you sure you want to change the base?
Added mock code #1883
Conversation
Wrong placement. There shouldn't be a |
src/mock/class_objectProcessor.py
Outdated
# objectProcessorQueue. Assuming that Bitmessage wasn't closed | ||
# forcefully, it should have saved the data in the queue into the | ||
# objectprocessorqueue table. Let's pull it out. | ||
sql_ready.wait() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it will never happen
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the time being we can skip this, yes.
src/mock/class_objectProcessor.py
Outdated
# forcefully, it should have saved the data in the queue into the | ||
# objectprocessorqueue table. Let's pull it out. | ||
sql_ready.wait() | ||
queryreturn = sqlQuery( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not a mock class because it uses sqlQuery()
from helper_sql
, thus depends on the sqlThread
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#1794 contains a test sql class (runs in-memory database and allows custom schema initialization), that will be used here as well.
There are some technical difficulties with such an approach at the moment, needs a bit more work to fix it. |
src/tests/mock/bitmessagemock.py
Outdated
@@ -0,0 +1,3 @@ | |||
def main(): | |||
"""Mock main function""" | |||
pass |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here it can start launching the mock threads.
""" | ||
def __init__(self): | ||
threading.Thread.__init__(self, name="objectProcessor") | ||
random.seed() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
25 - 41 - remove
…ory, connectionpool & stats
…emock file & moved mock folder to tests
Added mock code for class_objectProcessor, class_singleWorker, inventory, connectionpool & stats