Skip to content

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

Draft
wants to merge 10 commits into
base: v0.6
Choose a base branch
from
Draft

Added mock code #1883

wants to merge 10 commits into from

Conversation

kdcis
Copy link
Contributor

@kdcis kdcis commented Nov 15, 2021

Added mock code for class_objectProcessor, class_singleWorker, inventory, connectionpool & stats

@g1itch g1itch marked this pull request as draft November 15, 2021 16:24
@g1itch
Copy link
Collaborator

g1itch commented Nov 15, 2021

Wrong placement. There shouldn't be a mock package, because the end user doesn't need it. Please move into tests.

# 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()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it will never happen

Copy link
Member

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.

# forcefully, it should have saved the data in the queue into the
# objectprocessorqueue table. Let's pull it out.
sql_ready.wait()
queryreturn = sqlQuery(
Copy link
Collaborator

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

Copy link
Member

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.

@PeterSurda
Copy link
Member

Wrong placement. There shouldn't be a mock package, because the end user doesn't need it. Please move into tests.

There are some technical difficulties with such an approach at the moment, needs a bit more work to fix it.

@@ -0,0 +1,3 @@
def main():
"""Mock main function"""
pass
Copy link
Member

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()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

25 - 41 - remove

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants