-
Notifications
You must be signed in to change notification settings - Fork 1
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
Global topics #18
base: master
Are you sure you want to change the base?
Global topics #18
Changes from 13 commits
6e4fa10
f8be8ad
418b564
842ba9b
84e020b
6a86483
d444427
ff30ded
7c6ad65
0aec5df
41bd085
581508d
b7fb25f
f03e813
5dc528b
7e8996a
5451ccc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -122,6 +122,101 @@ def _create_session(cursor, session_id, user_id): | |
) | ||
|
||
|
||
def _create_global_topics(cursor): | ||
# type: (psycopg2.extensions.cursor) -> None | ||
|
||
cursor.execute( | ||
"insert into phpbb_topics (" | ||
"topic_id" | ||
",forum_id" | ||
",topic_title" | ||
",topic_time" | ||
",topic_first_poster_name" | ||
",topic_first_post_id" | ||
",topic_type" | ||
") values (" | ||
"0" | ||
",0" | ||
",'topic title 0'" | ||
",10" | ||
",'name'" | ||
",0,3" | ||
"), (" | ||
"1," | ||
"0," | ||
"'topic title 1'," | ||
"13," | ||
"'second poster'," | ||
"1," | ||
"3" | ||
"), (" | ||
"2" | ||
",0" | ||
",'topic title 2'" | ||
",200" | ||
",'post it'" | ||
",2," | ||
"3" | ||
"), (" | ||
"3" | ||
",0" | ||
",'topic title 3'" | ||
",256" | ||
",'posted it'" | ||
",3" | ||
",3" | ||
"), (" | ||
"4" | ||
",0" | ||
",'topic title 4'" | ||
",666" | ||
",'posted it again'" | ||
",3" | ||
",3" | ||
") , (" | ||
"6" | ||
",0" | ||
",'topic title 5'" | ||
",777" | ||
",'posted as 7, expecting 6'" | ||
",3" | ||
",3" | ||
") , (" | ||
"7" | ||
",0" | ||
",'different data type'" | ||
",999" | ||
",'inserted into table, expecting different type'" | ||
",3" | ||
",3" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should this number be something else (topic_type)? I see in your dataset you have only topic_type 3. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have set up one example where topic_type is different from 3. But the select expression for global topics has a where clause with a condition that topic_type = 3. So I think it would make sense to have most of examples fulfilling this condition. |
||
")" | ||
) | ||
|
||
cursor.execute( | ||
" insert into phpbb_posts (" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Be careful! You have Add posts before changing your tests to see if it will break your tests. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Posts have been added in the next commit. |
||
"post_id" | ||
",post_subject" | ||
",post_text" | ||
") values (" | ||
"0" | ||
",'topic one'" | ||
", 'hello'" | ||
"), (" | ||
"1" | ||
",'topic two'" | ||
",'hello world'" | ||
"), (" | ||
"2" | ||
",'topic three'" | ||
",'hello hello'" | ||
"), (" | ||
"3" | ||
",'topic three'" | ||
",'hello times four'" | ||
")" | ||
) | ||
|
||
|
||
def _create_privilege(cursor, privilege_id, privilege): | ||
# type: (psycopg2.extensions.cursor, int, str) -> None | ||
cursor.execute( | ||
|
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.
Whitespace in strings are missing (simulating you would be writing into a file).
Also, I see you could congest each row into one line. While keeping field list with each column in its own line (for readability).
Example: