diff --git a/src/rcgcdw.py b/src/rcgcdw.py
index acc6e3f..f5cd6d9 100644
--- a/src/rcgcdw.py
+++ b/src/rcgcdw.py
@@ -19,7 +19,7 @@
# WARNING! SHITTY CODE AHEAD. ENTER ONLY IF YOU ARE SURE YOU CAN TAKE IT
# You have been warned
-import time, logging.config, requests, datetime, math, os.path, schedule, sys, re, importlib, argparse
+import time, logging.config, requests, datetime, math, os.path, schedule, sys, re, importlib
import src.misc
import src.configloader
diff --git a/test/mockserver/data/response_diff20748742075224.json b/test/mockserver/data/response_diff20748742075224.json
new file mode 100644
index 0000000..9395bfe
--- /dev/null
+++ b/test/mockserver/data/response_diff20748742075224.json
@@ -0,0 +1,5 @@
+{
+ "compare": {
+ "*": "
\n Line 8: | \n Line 8: | \n
\n\n | \n | grasscolor = {{color|#8EB971}}{{only|java|short=y}}<br>{{Check the code}}{{only|bedrock|short=y}} | \n | \n | grasscolor = {{color|#8EB971}}{{only|java|short=y}}<br>{{Check the code}}{{only|bedrock|short=y}} | \n
\n\n | \n | foliagecolor = {{color|#71A74D}}{{only|java|short=y}}<br>{{Check the code}}{{only|bedrock|short=y}} | \n | \n | foliagecolor = {{color|#71A74D}}{{only|java|short=y}}<br>{{Check the code}}{{only|bedrock|short=y}} | \n
\n\n | \n + | \n | waterc | \n
\n\n − | \n | watercolor = {{color|#3F76E4}}{{only|java|short=y}}<br>{{Check the code}}{{only|bedrock|short=y}} | \n | \n
\n\n − | \n | structures ={{EnvLink|Dungeon}}s<br>{{EnvLink|Mineshaft}}s<br>{{EnvLink|Stronghold}}s<br>{{EnvLink|Amethyst Geode}}s
| \n + | \n Dripleaf}}<br>{{BlockLink|Cave Vines}}<br>{{BlockLink|Spore Blossom}}<br>{{ItemLink|Glow Berries}}}} | \n
\n\n − | \n | blocks = {{BlockLink|Oak Log}}<br>{{BlockLink|Azalea Leaves}}<br>{{BlockLink|Flowering Azalea Leaves}}<br>{{BlockLink|Azalea}}<br>{{BlockLink|Flowering Azalea}}<br>{{BlockLink|Rooted Dirt}}<br>{{BlockLink|Hanging Roots}}<br>{{BlockLink|Moss Block}}<br>{{BlockLink|Moss Carpet}}<br>{{BlockLink|Grass}}<br>{{BlockLink|Tall Grass}}<br>{{BlockLink|Vines}}<br>{{BlockLink|Water}}<br>{{BlockLink|Clay}}<br>{{BlockLink|Small Dripleaf}}<br>{{BlockLink|Big Dripleaf}}<br>{{BlockLink|Cave Vines}}<br>{{BlockLink|Spore Blossom}}<br>{{ItemLink|Glow Berries}}}} | \n | \n
\n\n | \n | \n | \n | \n
\n\n | \n A '''lush cave''' is a temperate [[Overworld]] [[cave]] [[biome]] that has a unique fauna and flora and is found underground below [[azalea tree]]s. | \n | \n A '''lush cave''' is a temperate [[Overworld]] [[cave]] [[biome]] that has a unique fauna and flora and is found underground below [[azalea tree]]s. | \n
\n\n\n"
+ }
+}
\ No newline at end of file
diff --git a/test/mockserver/data/response_diff20752242075225.json b/test/mockserver/data/response_diff20752242075225.json
new file mode 100644
index 0000000..f5c4023
--- /dev/null
+++ b/test/mockserver/data/response_diff20752242075225.json
@@ -0,0 +1,5 @@
+{
+ "compare": {
+ "*": "\n Line 8: | \n Line 8: | \n
\n\n | \n | grasscolor = {{color|#8EB971}}{{only|java|short=y}}<br>{{Check the code}}{{only|bedrock|short=y}} | \n | \n | grasscolor = {{color|#8EB971}}{{only|java|short=y}}<br>{{Check the code}}{{only|bedrock|short=y}} | \n
\n\n | \n | foliagecolor = {{color|#71A74D}}{{only|java|short=y}}<br>{{Check the code}}{{only|bedrock|short=y}} | \n | \n | foliagecolor = {{color|#71A74D}}{{only|java|short=y}}<br>{{Check the code}}{{only|bedrock|short=y}} | \n
\n\n | \n + | \n | watercolor = {{color|#3F76E4}}{{only|java|short=y}}<br>{{Check the code}}{{only|bedrock|short=y}} | \n
\n\n − | \n | waterc | \n | \n
\n\n − | \n Dripleaf}}<br>{{BlockLink|Cave Vines}}<br>{{BlockLink|Spore Blossom}}<br>{{ItemLink|Glow Berries}}}}
| \n + | \n | structures ={{EnvLink|Dungeon}}s<br>{{EnvLink|Mineshaft}}s<br>{{EnvLink|Stronghold}}s<br>{{EnvLink|Amethyst Geode}}s | \n
\n\n | \n + | \n | blocks = {{BlockLink|Oak Log}}<br>{{BlockLink|Azalea Leaves}}<br>{{BlockLink|Flowering Azalea Leaves}}<br>{{BlockLink|Azalea}}<br>{{BlockLink|Flowering Azalea}}<br>{{BlockLink|Rooted Dirt}}<br>{{BlockLink|Hanging Roots}}<br>{{BlockLink|Moss Block}}<br>{{BlockLink|Moss Carpet}}<br>{{BlockLink|Grass}}<br>{{BlockLink|Tall Grass}}<br>{{BlockLink|Vines}}<br>{{BlockLink|Water}}<br>{{BlockLink|Clay}}<br>{{BlockLink|Small Dripleaf}}<br>{{BlockLink|Big Dripleaf}}<br>{{BlockLink|Cave Vines}}<br>{{BlockLink|Spore Blossom}}<br>{{ItemLink|Glow Berries}}}} | \n
\n\n | \n | \n | \n | \n
\n\n | \n A '''lush cave''' is a temperate [[Overworld]] [[cave]] [[biome]] that has a unique fauna and flora and is found underground below [[azalea tree]]s. | \n | \n A '''lush cave''' is a temperate [[Overworld]] [[cave]] [[biome]] that has a unique fauna and flora and is found underground below [[azalea tree]]s. | \n
\n\n\n"
+ }
+}
\ No newline at end of file
diff --git a/test/mockserver/data/response_diff20752302075231.json b/test/mockserver/data/response_diff20752302075231.json
new file mode 100644
index 0000000..e6c5d7f
--- /dev/null
+++ b/test/mockserver/data/response_diff20752302075231.json
@@ -0,0 +1,5 @@
+{
+ "compare": {
+ "*": "\n Line 1: | \n Line 1: | \n
\n\n − | \n <br />{{Redirect|1.7.10|the Bedrock Edition version|Bedrock Edition 1.17.10|the New Nintendo 3DS Edition version|New Nintendo 3DS Edition 1.7.10}}
| \n + | \n {{Redirect|1.7.10|the Bedrock Edition version|Bedrock Edition 1.17.10|the New Nintendo 3DS Edition version|New Nintendo 3DS Edition 1.7.10}} | \n
\n\n | \n {{distinguish|Java Edition 1.7.1}} | \n | \n {{distinguish|Java Edition 1.7.1}} | \n
\n\n | \n {{version nav | \n | \n {{version nav | \n
\n\n − | \n | title = Minecraft 1.7.10 | \n + | \n |title=Minecraft 1.7.10 | \n
\n\n − | \n | edition = java | \n + | \n |edition=java | \n
\n\n − | \n | image = Java Edition 1.7.10.png | \n + | \n |image=Java Edition 1.7.10.png | \n
\n\n − | \n | date = June 26, 2014 | \n + | \n |date=June 26, 2014 | \n
\n\n − | \n | clienthash = e80d9b3bf5085002218d4be59e668bac718abbc6 | \n + | \n |clienthash=e80d9b3bf5085002218d4be59e668bac718abbc6 | \n
\n\n − | \n | jsonhash = 2e818dc89e364c7efcfa54bec7e873c5f00b3840 | \n + | \n |jsonhash=2e818dc89e364c7efcfa54bec7e873c5f00b3840 | \n
\n\n − | \n | serverhash = 952438ac4e01b4d115c5fc38f891710c4941df29 | \n + | \n |serverhash=952438ac4e01b4d115c5fc38f891710c4941df29 | \n
\n\n − | \n | exehash = a79b91ef69b9b4af63d1c7007f60259106869b21 | \n + | \n |exehash=a79b91ef69b9b4af63d1c7007f60259106869b21 | \n
\n\n − | \n | prevparent = 1.7.2 | \n + | \n |prevparent=1.7.2 | \n
\n\n − | \n | prev = 1.7.9 | \n + | \n |prev=1.7.9 | \n
\n\n − | \n | nextparent = 1.8 | \n + | \n |nextparent=1.8 | \n
\n\n | \n }}<onlyinclude> | \n | \n }}<onlyinclude> | \n
\n\n | \n | \n | \n | \n
\n\n\n"
+ }
+}
\ No newline at end of file
diff --git a/test/mockserver/data/response_diff2325552075232.json b/test/mockserver/data/response_diff2325552075232.json
new file mode 100644
index 0000000..871b21d
--- /dev/null
+++ b/test/mockserver/data/response_diff2325552075232.json
@@ -0,0 +1,5 @@
+{
+ "compare": {
+ "*": "\n Line 1: | \n Line 1: | \n
\n\n | \n {{DungeonsDLC|Jungle Awakens}} | \n | \n {{DungeonsDLC|Jungle Awakens}} | \n
\n\n | \n {{DungeonsEntity | \n | \n {{DungeonsEntity | \n
\n\n | \n + | \n |title=Leapleaf | \n
\n\n − | \n |title=បានឲ្យដឹង | \n | \n
\n\n | \n |image=Leapleaf.png | \n | \n |image=Leapleaf.png | \n
\n\n | \n |imagesize=x240px | \n | \n |imagesize=x240px | \n
\n\n | \n + | \n |behavior=Hostile | \n
\n\n − | \n |behavior=នៅថ្ងៃទីនោះបាន | \n | \n
\n\n | \n }} | \n | \n }} | \n
\n\n | \n | \n | \n | \n
\n\n | \n + | \n A '''leapleaf''', known internally as a '''leaper''', is a [[MCD:Mob#Hostile|hostile mob]] found in the ''[[Minecraft Dungeons]]'' [[MCD:Jungle Awakens|Jungle Awakens]] DLC that was corrupted by a shard of the [[MCD:Orb of Dominance|orb of dominance]]. | \n
\n\n − | \n ការ '''បាននិយាយ''', លោកជំទាវម៉ែត្រឡបានធ្វើឱ្យមានភាព'''ការប្រកួត''', ម៉ោងក្នុង [[MCD:Mob#Hostile|នៅក្នុងភូមិសាស្ត្រស្រុក]] 5បានឲ្យដឹងថាមុននឹងឈាន ''[[Minecraft Dungeons|ការប្រកួតកីឡាបាល់ទាត់កម្ពុជាបានថ្លែងថាក្រុម]]'' [[MCD:Jungle Awakens|ឡដ្ឋានជាតិអូឡាំពិកកម្ពុជា]] បាននិយាយថាខ្លួនការប្រកួតកីឡាបាល់ទាត់កម្ពុជាបានថ្លែង [[MCD:Orb of Dominance|នៅក្នុងការភូមិសាស្ត្រឃុំខ្លួនជន]]. | \n | \n
\n\n | \n | \n | \n | \n
\n\n | \n + | \n == Spawning == | \n
\n\n − | \n == ការពិភាក្សារបស់អ្នកប្រើ == | \n | \n
\n\n − | \n * {{DuLevelLink|Dingy Jungle|ការពិភាក្សាអំពី}} | \n + | \n * {{DuLevelLink|Dingy Jungle}} | \n
\n\n − | \n * {{DuLevelLink|Panda Plateau|ជាមួយក្រុមមានបាន}} | \n + | \n * {{DuLevelLink|Panda Plateau}} | \n
\n\n − | \n * {{DuLevelLink|Overgrown Temple|ឃន៍របស់អ្នកស្រីមាន}} | \n + | \n * {{DuLevelLink|Overgrown Temple}} | \n
\n\n − | \n * {{DuLevelLink|Tower|កសបានឡែក}} | \n + | \n * {{DuLevelLink|Tower}} | \n
\n\n | \n | \n | \n | \n
\n\n | \n + | \n == Behavior == | \n
\n\n − | \n == ការពិភាក្សា == | \n | \n
\n\n | \n + | \n A leapleaf has four different behaviors. It cannot be stunned by normal attacks, except [[MCD:Shock Powder|Shock Powder]] and any weapon with the [[MCD:Stunning|Stunning]] enchantment. | \n
\n\n − | \n នៅការពិភាក្សាដ្ឋាននគរបាលខណ្ឌចំការមនបានធ្វើឱ្យនាងបាននិយាយថាលោកបានបន្ថែមថា. ផងដែរថានៅពេលនោះមកវិញនូវភាព, ធរដ្ឋមន្ត្រីនៃព្រះរាជាព្រះ[[MCD:Shock Powder|ដែលមានឈ្មោះបោះថា]]បានធ្វើឲ្យអ្នកជិះម៉ូតូម៉ាកវ៉េវអាល់ហ្វា[[MCD:Stunning|ឌថាការ]] ណបក្សសង្គ្រោះជាតិបានឲ្យដឹង. | \n | \n
\n\n | \n | \n | \n | \n
\n\n | \n + | \n ;Basic attack | \n
\n\n − | \n ;ការពិភាក្សារបស់អ្នកប្រើ | \n | \n
\n\n | \n + | \n If a leapleaf is not currently charging or resting, it smashes any nearby targets with one of its arms, dealing notable damage. | \n
\n\n − | \n ការពិភាក្សាអំពីវិគីស្ថានបានធ្វើឲ្យប៉ះពាល់ដល់បរិស្ថានបានធ្វើ, ជកម្មខេត្តបន្ទាយមានជ័យដែលជាក្រុមហ៊ុននេះបាន, ឡដ្ឋាននគរវតការធ្វើដំណើរមកដល់. | \n | \n
\n\n | \n | \n | \n | \n
\n\n | \n + | \n ;Charge | \n
\n\n − | \n ;ការពិភាក្សា | \n | \n
\n\n | \n + | \n After a leapleaf does a chest-pouding animation, it would begin running toward the target. | \n
\n\n − | \n នៅក្នុងភូមិត្រពាំងថ្លឹងសង្កាត់ចោមចៅ, ទីក្រុងញូវយការប្រកួតនេះបានកើត. | \n | \n
\n\n | \n | \n | \n | \n
\n\n | \n + | \n ;Heavy attack | \n
\n\n − | \n ;ការពិភាក្សា | \n | \n
\n\n | \n + | \n When in melee reach of the target, it leaps foward and smashes the ground, dealing massive damage. | \n
\n\n − | \n កលនៅក្នុងភូមិសាស្ត្រឃុំស្រុក, ម៉ោងប្រមាណជិតខាងរបស់លោកស្រីយីហោណាមួយដែលអាចធ្វើឱ្យ,លោកបានបញ្ជាក់ពីការមូលហេតុដែលធ្វើ. | \n | \n
\n\n | \n | \n | \n | \n
\n\n | \n + | \n ;Rest | \n
\n\n − | \n ;ការពិភាក្សា | \n | \n
\n\n | \n + | \n After doing this, it may become stunned and rest on the ground for a few seconds. | \n
\n\n − | \n ការពិភាក្សាអំពីវិនិច្ឆ័យទោសតាម,និងលោកជំទាវម៉ែតនិងលោកស្រីយីហោណាមួយ.ភីឌបានធ្វើឱ្យអ្នកបើករថយន្តទៅលើ. | \n | \n
\n\n | \n | \n | \n | \n
\n\n | \n + | \n == Health == | \n
\n\n − | \n == ការពិភាក្សា == | \n | \n
\n\n | \n (In other versions, this any not be 100% accurate) | \n | \n (In other versions, this any not be 100% accurate) | \n
\n\n | \n {| class=\"wikitable sortable\" | \n | \n {| class=\"wikitable sortable\" | \n
\n\n | \n + | \n ! Power | \n
\n\n − | \n ! ទីនេះមាននូវការ | \n | \n
\n\n | \n + | \n ! Min Health | \n
\n\n − | \n ! សូមអរគុណដល់អ្នកទៅកាន់ទី | \n | \n
\n\n | \n |- | \n | \n |- | \n
\n\n | \n | 1 | \n | \n | 1 | \n
\n\n\n"
+ }
+}
\ No newline at end of file
diff --git a/test/mockserver/data/response_diff2325562075234.json b/test/mockserver/data/response_diff2325562075234.json
new file mode 100644
index 0000000..e9002ab
--- /dev/null
+++ b/test/mockserver/data/response_diff2325562075234.json
@@ -0,0 +1,5 @@
+{
+ "compare": {
+ "*": "\n Line 28: | \n Line 28: | \n
\n\n | \n | \n | \n | \n
\n\n | \n ; [[Blue Key|Blauer Schlüssel]] | \n | \n ; [[Blue Key|Blauer Schlüssel]] | \n
\n\n − | \n * Der Überlieferung nach soll dieser \"rote Türen öffnen\". | \n + | \n * Der Überlieferung nach soll dieser \"blaue Türen öffnen\". | \n
\n\n | \n * Wird vom [[Großer_Wächter|Großen Wächter]] fallen gelassen. | \n | \n * Wird vom [[Großer_Wächter|Großen Wächter]] fallen gelassen. | \n
\n\n | \n | \n | \n | \n
\n\n | \n ; [[Yellow Key|Gelber Schlüssel]] | \n | \n ; [[Yellow Key|Gelber Schlüssel]] | \n
\n\n − | \n * Der Überlieferung nach soll dieser \"rote Türen öffnen\". | \n + | \n * Der Überlieferung nach soll dieser \"gelbe Türen öffnen\". | \n
\n\n | \n * Wird vom [[Verwüster]] fallen gelassen. | \n | \n * Wird vom [[Verwüster]] fallen gelassen. | \n
\n\n | \n | \n | \n | \n
\n\n Line 103: | \n Line 103: | \n
\n\n | \n | \n | \n | \n
\n\n | \n ; Beute | \n | \n ; Beute | \n
\n\n | \n + | \n {| class=\"wikitable collapsible\" | \n
\n\n − | \n {| {{BtK|Bonus Fass|bonus_barrel|t=1}} | \n | \n
\n\n | \n + | \n ! colspan=\"3\" | Verlies Truheninhalt | \n
\n\n | \n |- | \n | \n |- | \n
\n\n | \n + | \n ! Gegenstand | \n
\n\n − | \n | colspan=\"9\" | Beutetabellen Inhalt | \n | \n
\n\n | \n + | \n ! Wahrscheinlichkeit | \n
\n\n | \n + | \n ! Stapelgröße | \n
\n\n | \n |- | \n | \n |- | \n
\n\n | \n + | \n | colspan=\"3\" | In jeder Truhe <b>sind ein Stapel</b> aus der Gruppe dieser Gegenstände enthalten | \n
\n\n − | \n | {{BtE|3D Shareware v1.34}} | \n | \n
\n\n | \n + | \n |- | \n
\n\n | \n + | \n | {{BS|Luft}} Nichts | \n
\n\n | \n + | \n | 66,7 % | \n
\n\n | \n + | \n | 1 | \n
\n\n | \n + | \n |- | \n
\n\n | \n + | \n | {{GL|Roter Schlüssel|3D Shareware v1.34#Neuerungen|Roter Schlüssel}} | \n
\n\n | \n + | \n | 20,8 % | \n
\n\n | \n + | \n | 1 | \n
\n\n | \n + | \n |- | \n
\n\n | \n + | \n | {{GL|Gelber Schlüssel|3D Shareware v1.34#Neuerungen|Gelber Schlüssel}} | \n
\n\n | \n + | \n | 8,3 % | \n
\n\n | \n + | \n | 1 | \n
\n\n | \n + | \n |- | \n
\n\n | \n + | \n | {{GL|Blauer Schlüssel|3D Shareware v1.34#Neuerungen|Blauer Schlüssel}} | \n
\n\n | \n + | \n | 4,2 % | \n
\n\n | \n + | \n | 1 | \n
\n\n | \n + | \n |- | \n
\n\n | \n + | \n | colspan=\"3\" | In jeder Truhe <b>sind ein bis vier Stapel</b> aus der Gruppe dieser Gegenstände enthalten | \n
\n\n | \n + | \n |- | \n
\n\n | \n + | \n | {{GL|Pfeil}} | \n
\n\n | \n + | \n | 10,9 % | \n
\n\n | \n + | \n | 1-20 | \n
\n\n | \n + | \n |- | \n
\n\n | \n + | \n | {{GL|Getränkter Pfeil|Pfeil|Getränkter Pfeil}} | \n
\n\n | \n + | \n | 10,9 % | \n
\n\n | \n + | \n | 1-20 | \n
\n\n | \n + | \n |- | \n
\n\n | \n + | \n | {{GL|Bogen|Bogen|Verzauberter Bogen}} | \n
\n\n | \n + | \n | 10,9 % | \n
\n\n | \n + | \n | 1 | \n
\n\n | \n + | \n |- | \n
\n\n | \n + | \n | {{GL|Steinschwert|Steinschwert|Verzaubertes Steinschwert}} | \n
\n\n | \n + | \n | 10,9 % | \n
\n\n | \n + | \n | 1 | \n
\n\n | \n + | \n |- | \n
\n\n | \n + | \n | {{GL|Verweiltrank|Verweiltrank|Zufälliger Verweiltrank}} | \n
\n\n | \n + | \n | 10,9 % | \n
\n\n | \n + | \n | 1 | \n
\n\n | \n + | \n |- | \n
\n\n | \n + | \n | {{GL|Wurftrank|Wurftrank|Zufälliger Wurftrank}} | \n
\n\n | \n + | \n | 10,9 % | \n
\n\n | \n + | \n | 1 | \n
\n\n | \n + | \n |- | \n
\n\n | \n + | \n | {{GL|Trank|Trank|Zufälliger Trank}} | \n
\n\n | \n + | \n | 10,9 % | \n
\n\n | \n + | \n | 1 | \n
\n\n | \n + | \n |- | \n
\n\n | \n + | \n | {{GL|Armbrust|Armbrust|BFC9000}} <ref group=\"Anm.\" name=\"Armbrust\"/> | \n
\n\n | \n + | \n | 10,9 % | \n
\n\n | \n + | \n | 1 | \n
\n\n | \n + | \n |- | \n
\n\n | \n + | \n | {{GL|Lederkappe|Lederkappe|Verzauberte Lederkappe}} | \n
\n\n | \n + | \n | 10,9 % | \n
\n\n | \n + | \n | 1 | \n
\n\n | \n + | \n |- | \n
\n\n | \n + | \n | {{GL|Lederjacke|Lederjacke|Verzauberte Lederjacke}} | \n
\n\n | \n + | \n | 10,9 % | \n
\n\n | \n + | \n | 1 | \n
\n\n | \n + | \n |- | \n
\n\n | \n + | \n | {{GL|Lederhose|Lederhose|Verzauberte Lederhose}} | \n
\n\n | \n + | \n | 10,9 % | \n
\n\n | \n + | \n | 1 | \n
\n\n | \n + | \n |- | \n
\n\n | \n + | \n | {{GL|Lederstiefel|Lederstiefel|Verzauberte Lederstiefel}} | \n
\n\n | \n + | \n | 10,9 % | \n
\n\n | \n + | \n | 1 | \n
\n\n | \n + | \n |- | \n
\n\n | \n + | \n | {{GL|Eisenschwert|Eisenschwert|Verzaubertes Eisenschwert}} | \n
\n\n | \n + | \n | 10,9 % | \n
\n\n | \n + | \n | 1 | \n
\n\n | \n + | \n |- | \n
\n\n | \n + | \n | {{GL|Eisenhelm|Eisenhelm|Verzauberter Eisenhelm}} | \n
\n\n | \n + | \n | 10,9 % | \n
\n\n | \n + | \n | 1 | \n
\n\n | \n + | \n |- | \n
\n\n | \n + | \n | {{GL|Eisenharnisch|Eisenharnisch|Verzauberter Eisenharnisch}} | \n
\n\n | \n + | \n | 10,9 % | \n
\n\n | \n + | \n | 1 | \n
\n\n | \n + | \n |- | \n
\n\n | \n + | \n | {{GL|Eisenbeinschutz|Eisenbeinschutz|Verzauberter Eisenbeinschutz}} | \n
\n\n | \n + | \n | 10,9 % | \n
\n\n | \n + | \n | 1 | \n
\n\n | \n + | \n |- | \n
\n\n | \n + | \n | {{GL|Eisenstiefel|Eisenstiefel|Verzauberte Eisenstiefel}} | \n
\n\n | \n + | \n | 10,9 % | \n
\n\n | \n + | \n | 1 | \n
\n\n | \n + | \n |- | \n
\n\n | \n + | \n | {{GL|Diamantschwert|Diamantschwert|Verzaubertes Diamantschwert}} | \n
\n\n | \n + | \n | 10,9 % | \n
\n\n | \n + | \n | 1 | \n
\n\n | \n + | \n |- | \n
\n\n | \n + | \n | {{GL|Diamanthelm|Diamanthelm|Verzauberter Diamanthelm}} | \n
\n\n | \n + | \n | 10,9 % | \n
\n\n | \n + | \n | 1 | \n
\n\n | \n + | \n |- | \n
\n\n | \n + | \n | {{GL|Diamantharnisch|Diamantharnisch|Verzauberter Diamantharnisch}} | \n
\n\n | \n + | \n | 10,9 % | \n
\n\n | \n + | \n | 1 | \n
\n\n | \n + | \n |- | \n
\n\n | \n + | \n | {{GL|Diamantbeinschutz|Diamantbeinschutz|Verzauberter Diamantbeinschutz}} | \n
\n\n | \n + | \n | 10,9 % | \n
\n\n | \n + | \n | 1 | \n
\n\n | \n + | \n |- | \n
\n\n | \n + | \n | {{GL|Diamantstiefel|Diamantstiefel|Verzauberte Diamantstiefel}} | \n
\n\n | \n + | \n | 10,9 % | \n
\n\n | \n + | \n | 1 | \n
\n\n | \n |} | \n | \n |} | \n
\n\n | \n + | \n {{Verweisliste|group=\"Anm.\"|ref= | \n
\n\n | \n + | \n <ref name=\"Armbrust\">Jede Stufe zwischen 1 und 12 von [[Mehrfachschuss]] ist gleich wahrscheinlich.</ref> | \n
\n\n | \n + | \n }} | \n
\n\n | \n | \n | \n | \n
\n\n | \n ===Kreaturen=== | \n | \n ===Kreaturen=== | \n
\n\n\n"
+ }
+}
\ No newline at end of file
diff --git a/test/mockserver/data/response_recentchanges.json b/test/mockserver/data/response_recentchanges.json
index 201eca5..6693225 100644
--- a/test/mockserver/data/response_recentchanges.json
+++ b/test/mockserver/data/response_recentchanges.json
@@ -139,10 +139,10 @@
"rcid": 2793424,
"user": "Good User",
"anon": "",
- "oldlen": 811,
- "newlen": 771,
+ "oldlen": 771,
+ "newlen": 811,
"timestamp": "2021-12-26T12:13:38Z",
- "parsedcomment": "Unfo revision by 192.168.1.1. Reason: Mad cats",
+ "parsedcomment": "Undo revision by 192.168.1.1. Reason: Mad cats",
"tags": [
"visualeditor"
]
@@ -157,8 +157,8 @@
"rcid": 2793423,
"user": "192.168.1.1",
"anon": "",
- "oldlen": 771,
- "newlen": 811,
+ "oldlen": 811,
+ "newlen": 771,
"timestamp": "2021-12-26T12:09:18Z",
"parsedcomment": "Hahahahhaha, you will never understand my genius!",
"tags": [
diff --git a/test/mockserver/results/results1.json b/test/mockserver/results/results1.json
index e69de29..ace744f 100644
--- a/test/mockserver/results/results1.json
+++ b/test/mockserver/results/results1.json
@@ -0,0 +1 @@
+[{"allowed_mentions": {"parse": []}, "avatar_url": "", "embeds": [{"color": 12390624, "url": "http://localhost:8080/wiki/File:Oak_Sign_%289%29.png", "title": "Uploaded File\\:Oak Sign (9).png", "fields": [{"name": "Options", "value": "([preview](http://localhost:8080/test_wiki/images/7/75/Oak_Sign_%289%29.png/revision/latest?cb=20211226120904?8204354331))", "inline": false}], "image": {"url": "http://localhost:8080/test_wiki/images/7/75/Oak_Sign_%289%29.png/revision/latest?cb=20211226120904?8204354331"}, "author": {"name": "User1", "url": "http://localhost:8080/wiki/User:User1", "icon_url": "https://i.imgur.com/egJpa81.png"}, "timestamp": "2021-12-26T12:09:04Z", "description": "No description provided\nLicense: Mojang"}]}, {"allowed_mentions": {"parse": []}, "avatar_url": "", "embeds": [{"color": 9175040, "url": "http://localhost:8080/index.php?title=Java_Edition_1.19&curid=177589&diff=2075224&oldid=2074874", "title": "Java Edition 1.19 (-40)", "fields": [{"name": "Removed", "value": "\n~~\\| watercolor = \\{\\{color\\|#3F76E4\\}\\}\\{\\{only\\|java\\|short=y\\}\\}\\
\\{\\{Check the code\\}\\}\\{\\{only\\|bedrock\\|short=y\\}\\}~~\n~~\\| structures =\\{\\{EnvLink\\|Dungeon~~\\}\\}~~s~~\\
\\{\\{~~EnvLink~~\\|~~Mineshaft~~\\}\\}~~s~~\\
\\{\\{~~EnvLink~~\\|~~Stronghold~~\\}\\}~~s~~\\
\\{\\{~~EnvLink~~\\|~~Amethyst~~ ~~Geode~~\\}\\}~~s~~\n\n__And more__", "inline": true}, {"name": "Added", "value": "\n**\\| waterc**\n**Dripleaf**\\}\\}\\
\\{\\{**BlockLink**\\|**Cave Vines**\\}\\}\\
\\{\\{**BlockLink**\\|**Spore Blossom**\\}\\}\\
\\{\\{**ItemLink**\\|**Glow** **Berries\\}\\}**\\}\\}", "inline": true}, {"name": "Tags", "value": "Mobile edit, Visual edit", "inline": false}], "author": {"name": "192.168.1.1 (3)", "url": "http://localhost:8080/wiki/Special:Contributions/192.168.1.1", "icon_url": "https://i.imgur.com/zKYHkJm.png"}, "timestamp": "2021-12-26T12:09:18Z", "description": "Hahahahhaha, you will never understand my genius!"}]}, {"allowed_mentions": {"parse": []}, "avatar_url": "", "embeds": [{"color": 35840, "url": "http://localhost:8080/index.php?title=Java_Edition_1.19&curid=177589&diff=2075225&oldid=2075224", "title": "Java Edition 1.19 (+40)", "fields": [{"name": "Removed", "value": "\n~~\\| waterc~~\n~~Dripleaf~~\\}\\}\\
\\{\\{~~BlockLink~~\\|~~Cave Vines~~\\}\\}\\
\\{\\{~~BlockLink~~\\|~~Spore Blossom~~\\}\\}\\
\\{\\{~~ItemLink~~\\|~~Glow~~ ~~Berries\\}\\}~~\\}\\}", "inline": true}, {"name": "Added", "value": "\n**\\| watercolor = \\{\\{color\\|#3F76E4\\}\\}\\{\\{only\\|java\\|short=y\\}\\}\\
\\{\\{Check the code\\}\\}\\{\\{only\\|bedrock\\|short=y\\}\\}**\n**\\| structures =\\{\\{EnvLink\\|Dungeon**\\}\\}**s**\\
\\{\\{**EnvLink**\\|**Mineshaft**\\}\\}**s**\\
\\{\\{**EnvLink**\\|**Stronghold**\\}\\}**s**\\
\\{\\{**EnvLink**\\|**Amethyst** **Geode**\\}\\}**s**\n\n__And more__", "inline": true}, {"name": "Tags", "value": "Visual edit", "inline": false}], "author": {"name": "Good User (3)", "url": "http://localhost:8080/wiki/Special:Contributions/Good_User", "icon_url": "https://i.imgur.com/zKYHkJm.png"}, "timestamp": "2021-12-26T12:13:38Z", "description": "Undo revision by 192.168.1.1. Reason\\: Mad cats"}]}, {"allowed_mentions": {"parse": []}, "avatar_url": "", "embeds": [{"color": 1, "url": "http://localhost:8080/wiki/User:Spammer", "fields": [{"name": "Block flags", "value": "nocreate", "inline": false}], "title": "Blocked Spammer for 15 days, for 22 hours, for 23 minutes", "author": {"name": "Administrator", "url": "http://localhost:8080/wiki/User:Administrator", "icon_url": "https://i.imgur.com/g7KgZHf.png"}, "timestamp": "2021-12-26T12:15:04Z", "description": "[Rule #2]()\\: Spam"}]}, {"allowed_mentions": {"parse": []}, "avatar_url": "", "embeds": [{"color": 16089376, "author": {"name": "User2", "url": "http://localhost:8080/wiki/User:User2", "icon_url": ""}, "timestamp": "2021-12-26T12:20:11Z", "description": "Discord handle field changed to: CoolUser#1812", "title": "Edited their own profile", "url": "http://localhost:8080/wiki/UserProfile:User2"}]}, {"allowed_mentions": {"parse": []}, "avatar_url": "", "embeds": [{"color": 16711680, "url": "http://localhost:8080/wiki/User:FineUser2", "title": "Changed group membership for FineUser2", "fields": [{"name": "Added group", "value": "sysop", "inline": true}, {"name": "Removed groups", "value": "rollback\nautopatrol", "inline": true}], "author": {"name": "Administrator2", "url": "http://localhost:8080/wiki/User:Administrator2", "icon_url": ""}, "timestamp": "2021-12-26T12:40:00Z", "description": "No description provided"}]}, {"allowed_mentions": {"parse": []}, "avatar_url": "", "embeds": [{"color": 9175040, "url": "http://localhost:8080/index.php?title=Java_Edition_1.19&curid=177589&diff=2075231&oldid=2075230", "title": "Java Edition 1.19 (m -40)", "fields": [{"name": "Removed", "value": "\n~~\\
~~\\{\\{Redirect\\|1.7.10\\|the Bedrock Edition version\\|Bedrock Edition 1.17.10\\|the New Nintendo 3DS Edition version\\|New Nintendo 3DS Edition 1.7.10\\}\\}\n\\|~~ ~~title~~ ~~=~~ ~~Minecraft 1.7.10\n\\|~~ ~~edition~~ ~~=~~ ~~java\n\\|~~ ~~image~~ ~~=~~ ~~Java Edition 1.7.10.png\n\\|~~ ~~date~~ ~~=~~ ~~June 26, 2014\n\\|~~ ~~clienthash~~ ~~=~~ ~~e80d9b3bf5085002218d4be59e668bac718abbc6\n\\|~~ ~~jsonhash~~ ~~=~~ ~~2e818dc89e364c7efcfa54bec7e873c5f00b3840\n\\|~~ ~~serverhash~~ ~~=~~ ~~952438ac4e01b4d115c5fc38f891710c4941df29\n\\|~~ ~~exehash~~ ~~=~~ ~~a79b91ef69b9b4af63d1c7007f60259106869b21\n\\|~~ ~~prevparent~~ ~~=~~ ~~1.7.2\n\\|~~ ~~prev~~ ~~=~~ ~~1.7.9\n\\|~~ ~~nextparent~~ ~~=~~ ~~1.8", "inline": true}, {"name": "Added", "value": "\n\\{\\{Redirect\\|1.7.10\\|the Bedrock Edition version\\|Bedrock Edition 1.17.10\\|the New Nintendo 3DS Edition version\\|New Nintendo 3DS Edition 1.7.10\\}\\}\n\\|title=Minecraft 1.7.10\n\\|edition=java\n\\|image=Java Edition 1.7.10.png\n\\|date=June 26, 2014\n\\|clienthash=e80d9b3bf5085002218d4be59e668bac718abbc6\n\\|jsonhash=2e818dc89e364c7efcfa54bec7e873c5f00b3840\n\\|serverhash=952438ac4e01b4d115c5fc38f891710c4941df29\n\\|exehash=a79b91ef69b9b4af63d1c7007f60259106869b21\n\\|prevparent=1.7.2\n\\|prev=1.7.9\n\\|nextparent=1.8", "inline": true}, {"name": "Tags", "value": "Rollback", "inline": false}], "author": {"name": "User2", "url": "http://localhost:8080/wiki/User:User2", "icon_url": "https://i.imgur.com/zKYHkJm.png"}, "timestamp": "2021-12-26T12:24:23Z", "description": "Revert edits by [192.168.1.1]() (talk)"}]}, {"allowed_mentions": {"parse": []}, "avatar_url": "", "embeds": [{"color": 16711680, "url": "http://localhost:8080/index.php?title=Some_different_page&curid=9327&diff=2075232&oldid=232555", "title": "Some different page (-32554)", "fields": [{"name": "Removed", "value": "\n~~\\|title=\u1794\u17b6\u1793\u200b\u17b2\u17d2\u1799\u200b\u178a\u17b9\u1784\u200b~~\n~~\\|behavior=\u1793\u17c5\u200b\u1790\u17d2\u1784\u17c3\u200b\u1791\u17b8\u200b\u1793\u17c4\u17c7\u200b\u1794\u17b6\u1793\u200b~~\n~~\u1780\u17b6\u179a\u200b '''\u1794\u17b6\u1793\u200b\u1793\u17b7\u1799\u17b6\u1799\u200b''', \u179b\u17c4\u1780\u200b\u1787\u17c6\u1791\u17b6\u179c\u200b\u1798\u17c9\u17c2\u200b\u178f\u17d2\u179a\u200b\u17a1\u200b\u1794\u17b6\u1793\u200b\u1792\u17d2\u179c\u17be\u200b\u17b1\u17d2\u1799\u200b\u1798\u17b6\u1793\u200b\u1797\u17b6\u1796\u200b'''\u1780\u17b6\u179a\u200b\u1794\u17d2\u179a\u1780\u17bd\u178f\u200b''', \u1798\u17c9\u17c4\u1784\u200b\u1780\u17d2\u1793\u17bb\u1784\u200b [[MCD:Mob#Hostile\\|\u1793\u17c5\u200b\u1780\u17d2\u1793\u17bb\u1784\u200b\u1797\u17bc\u1798\u17b7\u200b\u179f\u17b6\u179f\u17d2\u178f\u17d2\u179a\u200b\u179f\u17d2\u179a\u17bb\u1780\u200b]] 5\u1794\u17b6\u1793\u200b\u17b2\u17d2\u1799\u200b\u178a\u17b9\u1784\u200b\u1790\u17b6\u200b\u1798\u17bb\u1793\u200b\u1793\u17b9\u1784\u200b\u1788\u17b6\u1793\u200b ''[[Minecraft Dungeons\\|\u1780\u17b6\u179a\u200b\u1794\u17d2\u179a\u1780\u17bd\u178f\u200b\u1780\u17b8\u17a1\u17b6\u200b\u1794\u17b6\u179b\u17cb\u200b\u1791\u17b6\u178f\u17cb\u200b\u1780\u1798\u17d2\u1796\u17bb\u1787\u17b6\u200b\u1794\u17b6\u1793\u200b\u1790\u17d2\u179b\u17c2\u1784\u200b\u1790\u17b6\u200b\u1780\u17d2\u179a\u17bb\u1798\u200b]]'' [[MCD:Jungle Awakens\\|\u17a1\u200b\u178a\u17d2\u178b\u17b6\u1793\u200b\u1787\u17b6\u178f\u17b7\u200b\u17a2\u17bc\u17a1\u17b6\u17c6\u1796\u17b7\u1780\u200b\u1780\u1798\u17d2\u1796\u17bb\u1787\u17b6\u200b]] \u1794\u17b6\u1793\u200b\u1793\u17b7\u1799\u17b6\u1799\u200b\u1790\u17b6\u200b\u1781\u17d2\u179b\u17bd\u1793\u200b\u1780\u17b6\u179a\u200b\u1794\u17d2\u179a\u1780\u17bd\u178f\u200b\u1780\u17b8\u17a1\u17b6\u200b\u1794\u17b6\u179b\u17cb\u200b\u1791\u17b6\u178f\u17cb\u200b\u1780\u1798\u17d2\u1796\u17bb\u1787\u17b6\u200b\u1794\u17b6\u1793\u200b\u1790\u17d2\u179b\u17c2\u1784\u200b [[MCD:Orb of Dominance\\|\u1793\u17c5\u200b\u1780\u17d2\u1793\u17bb\u1784\u200b\u1780\u17b6\u179a\u200b\u1797\u17bc\u1798\u17b7\u200b\u179f\u17b6\u179f\u17d2\u178f\u17d2\u179a\u200b\u1783\u17bb\u17c6\u200b\u1781\u17d2\u179b\u17bd\u1793\u200b\u1787\u1793\u200b]].~~\n~~== \u1780\u17b6\u179a\u200b\u1796\u17b7\u1797\u17b6\u1780\u17d2\u179f\u17b6\u200b\u179a\u1794\u179f\u17cb\u200b\u17a2\u17d2\u1793\u1780\u1794\u17d2\u179a\u17be ==~~\n\\* \\{\\{DuLevelLink\\|Dingy Jungle~~\\|\u1780\u17b6\u179a\u200b\u1796\u17b7\u1797\u17b6\u1780\u17d2\u179f\u17b6\u200b\u17a2\u17c6\u1796\u17b8\u200b~~\\}\\}\n\\* \\{\\{DuLevelLink\\|Panda Plateau~~\\|\u1787\u17b6\u200b\u1798\u17bd\u1799\u200b\u1780\u17d2\u179a\u17bb\u1798\u200b\u1798\u17b6\u1793\u200b\u1794\u17b6\u1793\u200b~~\\}\\}\n\\* \\{\\{DuLevelLink\\|Overgrown Temple~~\\|\u1783\u200b\u1793\u17cd\u200b\u179a\u1794\u179f\u17cb\u200b\u17a2\u17d2\u1793\u1780\u200b\u179f\u17d2\u179a\u17b8\u200b\u1798\u17b6\u1793\u200b~~\\}\\}\n\\* \\{\\{DuLevelLink\\|Tower~~\\|\u1780\u179f\u200b\u1794\u17b6\u1793\u200b\u17a1\u17c2\u200b\u1780\u200b~~\\}\\}\n~~== \u1780\u17b6\u179a\u200b\u1796\u17b7\u1797\u17b6\u1780\u17d2\u179f\u17b6\u200b ==~~\n\n__And more__", "inline": true}, {"name": "Added", "value": "\n**\\|title=Leapleaf**\n**\\|behavior=Hostile**\n**A '''leapleaf''', known internally as a '''leaper''', is a [[MCD:Mob#Hostile\\|hostile mob]] found in the ''[[Minecraft Dungeons]]'' [[MCD:Jungle Awakens\\|Jungle Awakens]] DLC that was corrupted by a shard of the [[MCD:Orb of Dominance\\|orb of dominance]].**\n**== Spawning ==**\n\\* \\{\\{DuLevelLink\\|Dingy Jungle\\}\\}\n\\* \\{\\{DuLevelLink\\|Panda Plateau\\}\\}\n\\* \\{\\{DuLevelLink\\|Overgrown Temple\\}\\}\n\\* \\{\\{DuLevelLink\\|Tower\\}\\}\n**== Behavior ==**\n**A leapleaf has four different behaviors. It cannot be stunned by normal attacks, except [[MCD:Shock Powder\\|Shock Powder]] and any weapon with the [[MCD:Stunning\\|Stunning]] enchantment.**\n**;Basic attack**\n**If a leapleaf is not currently charging or resting, it smashes any nearby targets with one of its arms, dealing notable damage.**\n**;Charge**\n**After a leapleaf does a chest-pouding animation, it would begin running toward the target.**\n**;Heavy attack**\n\n__And more__", "inline": true}], "author": {"name": "User3", "url": "http://localhost:8080/wiki/User:User3", "icon_url": "https://i.imgur.com/zKYHkJm.png"}, "timestamp": "2021-12-26T12:26:32Z", "description": "Some changes lol"}]}, {"allowed_mentions": {"parse": []}, "avatar_url": "", "embeds": [{"color": 9175040, "url": "http://localhost:8080/index.php?title=Java_Edition_1.19&curid=177589&diff=2075224&oldid=2074874", "title": "Java Edition 1.19 (-40)", "author": {"name": "hidden", "icon_url": "https://i.imgur.com/zKYHkJm.png"}, "timestamp": "2021-12-26T12:09:18Z", "description": "~~hidden~~"}]}, {"allowed_mentions": {"parse": []}, "avatar_url": "", "embeds": [{"color": 1, "author": {"name": "Frisk", "url": "http://localhost:8080/wiki/User:Frisk", "icon_url": "https://i.imgur.com/1gps6EZ.png"}, "timestamp": "2021-12-26T13:02:59Z", "description": "Heresy!", "url": "http://localhost:8080/wiki/Java_Edition_1.19", "title": "Changed visibility of revision on page Java Edition 1.19 "}]}, "DELETE/webhook//messages/8", {"allowed_mentions": {"parse": []}, "avatar_url": "", "embeds": [{"color": 1, "author": {"name": "Frisk", "url": "http://localhost:8080/wiki/User:Frisk", "icon_url": "https://i.imgur.com/BU77GD3.png"}, "timestamp": "2021-12-26T13:35:50Z", "description": "aaaaaaaaaaaaaaa", "url": "http://localhost:8080/wiki/Some_different_page", "title": "Deleted page Some different page"}]}, {"allowed_mentions": {"parse": []}, "avatar_url": "", "embeds": [{"color": 65280, "url": "http://localhost:8080/index.php?title=Unique_page&curid=9327&diff=2075234&oldid=232556", "title": "Unique page (+32554)", "fields": [{"name": "Removed", "value": "\n\\* Der \u00dcberlieferung nach soll dieser \"~~rote~~ T\u00fcren \u00f6ffnen\".\n\\* Der \u00dcberlieferung nach soll dieser \"~~rote~~ T\u00fcren \u00f6ffnen\".\n~~\\{\\| \\{\\{BtK\\|Bonus Fass\\|bonus\\_barrel\\|t=1\\}\\}~~\n~~\\| colspan=\"9\" \\| Beutetabellen Inhalt~~\n~~\\| \\{\\{BtE\\|3D Shareware v1.34\\}\\}~~", "inline": true}, {"name": "Added", "value": "\n\\* Der \u00dcberlieferung nach soll dieser \"**blaue** T\u00fcren \u00f6ffnen\".\n\\* Der \u00dcberlieferung nach soll dieser \"**gelbe** T\u00fcren \u00f6ffnen\".\n**\\{\\| class=\"wikitable collapsible\"**\n**! colspan=\"3\" \\| Verlies Truheninhalt**\n**! Gegenstand**\n**! Wahrscheinlichkeit**\n**! Stapelgr\u00f6\u00dfe**\n**\\| colspan=\"3\" \\| In jeder Truhe \\sind ein Stapel\\<\\/b\\> aus der Gruppe dieser Gegenst\u00e4nde enthalten**\n**\\|-**\n**\\| \\{\\{BS\\|Luft\\}\\} Nichts**\n**\\| 66,7 %**\n**\\| 1**\n**\\|-**\n**\\| \\{\\{GL\\|Roter Schl\u00fcssel\\|3D Shareware v1.34#Neuerungen\\|Roter Schl\u00fcssel\\}\\}**\n**\\| 20,8 %**\n**\\| 1**\n**\\|-**\n**\\| \\{\\{GL\\|Gelber Schl\u00fcssel\\|3D Shareware v1.34#Neuerungen\\|Gelber Schl\u00fcssel\\}\\}**\n**\\| 8,3 %**\n**\\| 1**\n**\\|-**\n**\\| \\{\\{GL\\|Blauer Schl\u00fcssel\\|3D Shareware v1.34#Neuerungen\\|Blauer Schl\u00fcssel\\}\\}**\n**\\| 4,2 %**\n**\\| 1**\n**\\|-**\n**\\| colspan=\"3\" \\| In jeder Truhe \\sind ein bis vier Stapel\\<\\/b\\> aus der Gruppe dieser Gegenst\u00e4nde enthalten**\n**\\|-**\n**\\| \\{\\{GL\\|Pfeil\\}\\}**\n**\\| 10,9 %**\n**\\| 1-20**\n**\\|-**\n\n__And more__", "inline": true}], "author": {"name": "User3", "url": "http://localhost:8080/wiki/User:User3", "icon_url": "https://i.imgur.com/zKYHkJm.png"}, "timestamp": "2021-12-26T13:37:10Z", "description": "Added content"}]}]
\ No newline at end of file
diff --git a/test/mockserver/server.py b/test/mockserver/server.py
index 22db113..05fa389 100644
--- a/test/mockserver/server.py
+++ b/test/mockserver/server.py
@@ -12,7 +12,6 @@
#
# You should have received a copy of the GNU General Public License
# along with RcGcDw. If not, see .
-import pprint
from http.server import BaseHTTPRequestHandler, HTTPServer
import json
import urllib.parse
@@ -20,9 +19,11 @@ import requests
response_jsons: dict[str, dict] = {}
+class EndOfContent(Exception):
+ pass
def load_response(name: str):
- with open("data/{}.json".format(name), "r") as response_file:
+ with open("data/response_{}.json".format(name), "r") as response_file:
response_json: dict = json.loads(response_file.read())
response_jsons[name] = response_json
@@ -31,16 +32,16 @@ def get_response(name: str):
return response_jsons.get(name)
-[load_response(x) for x in ["response_recentchanges", "response_recentchanges2", "response_init", "response_error", "response_siteinfo"
- "response_image", "response_userinfo"]]
+[load_response(x) for x in ["recentchanges", "recentchanges2", "init", "error", "siteinfo", "image", "userinfo"]]
messages_collector = []
-
+askedfor = False
# Return server response based on some output from Minecraft Wiki
class MockServerRequestHandler(BaseHTTPRequestHandler):
def do_GET(self):
+ global askedfor
# We assume testing will be for API endpoint only since RcGcDw doesn't do requests to other URLs so no need to check main path
# For simplicity, return a dictionary of query arguments, we assume duplicate keys will not appear
query = {k: y for (k, y) in urllib.parse.parse_qsl(self.path.split("?")[1])}
@@ -48,51 +49,61 @@ class MockServerRequestHandler(BaseHTTPRequestHandler):
# Regular pooled query for recentchanges
if query.get("list") == "recentchanges":
self.send_essentials_ok()
- if len(messages_collector) == 0:
+ if askedfor is False:
# Limit amount of events accordingly to required amount just in case
- response_jsons["response_recentchanges"]["query"]["recentchanges"] = get_response("response_recentchanges")["query"]["recentchanges"][0:int(query.get("rclimit", 20))]
- response_content = json.dumps(get_response("response_recentchanges"))
+ response_jsons["recentchanges"]["query"]["recentchanges"] = get_response("recentchanges")["query"]["recentchanges"][0:int(query.get("rclimit", 20))]
+ response_content = json.dumps(get_response("recentchanges"))
+ askedfor = True
else:
- response_jsons["response_recentchanges2"]["query"]["recentchanges"] = get_response("response_recentchanges2")["query"]["recentchanges"][0:int(query.get("rclimit", 20))]
- response_content = json.dumps(get_response("response_recentchanges2"))
+ response_jsons["recentchanges2"]["query"]["recentchanges"] = get_response("recentchanges2")["query"]["recentchanges"][0:int(query.get("rclimit", 20))]
+ response_content = json.dumps(get_response("recentchanges2"))
self.wfile.write(response_content.encode('utf-8'))
# Init info
elif query.get("list") == "tags" and query.get("meta") == "allmessages|siteinfo":
self.send_essentials_ok()
- response_content = json.dumps(get_response("response_init"))
+ response_content = json.dumps(get_response("init"))
self.wfile.write(response_content.encode('utf-8'))
elif query.get("meta") == "siteinfo":
self.send_essentials_ok()
- response_content = json.dumps(get_response("response_siteinfo"))
+ response_content = json.dumps(get_response("siteinfo"))
self.wfile.write(response_content.encode('utf-8'))
elif query.get("prop") == "imageinfo|revisions":
self.send_essentials_ok()
- response_content = json.dumps(get_response("response_image"))
+ response_content = json.dumps(get_response("image"))
self.wfile.write(response_content.encode('utf-8'))
elif query.get("list") == "usercontribs":
self.send_essentials_ok()
- response_content = json.dumps(get_response("response_userinfo"))
+ response_content = json.dumps(get_response("userinfo"))
self.wfile.write(response_content.encode('utf-8'))
else:
self.send_response(400)
self.send_header('Content-Type', 'application/json; charset=utf-8')
self.end_headers()
- response_content = json.dumps(get_response("response_error"))
+ response_content = json.dumps(get_response("error"))
self.wfile.write(response_content.encode('utf-8'))
+ elif query.get("action") == "compare":
+ self.send_essentials_ok()
+ name = "diff{}{}".format(query.get("fromrev"), query.get("torev"))
+ load_response(name)
+ response_content = json.dumps(get_response(name))
+ self.wfile.write(response_content.encode('utf-8'))
def do_POST(self):
- self.read_ok_collect()
+ self.read_ok_collect(method="POST")
def do_PATCH(self):
- self.read_ok_collect()
+ self.read_ok_collect(method="PATCH")
def do_DELETE(self):
- self.read_ok_collect()
+ self.read_ok_collect(method="DELETE")
- def read_ok_collect(self):
+ def read_ok_collect(self, method: str):
content_length = int(self.headers['Content-Length'])
patch_data = self.rfile.read(content_length)
- messages_collector.append(patch_data.decode('utf-8'))
+ if patch_data:
+ messages_collector.append(json.loads(patch_data.decode('utf-8')))
+ else:
+ messages_collector.append(method + self.path)
self.send_essentials_ok()
self.wfile.write(json.dumps({"id": len(messages_collector)}).encode('utf-8'))
@@ -102,12 +113,22 @@ class MockServerRequestHandler(BaseHTTPRequestHandler):
self.end_headers()
-def start_mock_server(port):
+def start_mock_server(port, config):
mock_server = HTTPServer(('localhost', port), MockServerRequestHandler)
try:
print("Server started successfully at http://localhost:{}".format(port))
- mock_server.serve_forever()
+ while 1:
+ if len(messages_collector) < 13:
+ mock_server.handle_request()
+ else:
+ raise EndOfContent
except KeyboardInterrupt:
print("Shutting down...")
- print(pprint.pprint(messages_collector))
- pass
+ except EndOfContent:
+ with open("results/results{}.json".format(config.config), "r") as proper_results:
+ if proper_results.read() == json.dumps(messages_collector):
+ print("Results are correct!")
+ else:
+ print("Results are incorrect, saving failed results to resultsfailed{}.json".format(config.config))
+ with open("results/resultsfailed{}.json".format(config.config), "w") as file_to_write:
+ file_to_write.write(json.dumps(messages_collector))
diff --git a/test/mockserver/start.py b/test/mockserver/start.py
index a8627f9..395e089 100644
--- a/test/mockserver/start.py
+++ b/test/mockserver/start.py
@@ -42,13 +42,14 @@ if not command_args.no_client:
shutil.move(old_config, backup_filename)
shutil.copy(new_settings, old_config)
# revert data file to some low number
- with open(pathlib.Path(__file__).parent.resolve().parent.resolve().parent.resolve().joinpath("data.json"), "r+") as data_file:
+ with open(pathlib.Path(__file__).parent.resolve().parent.resolve().parent.resolve().joinpath("data.json"), "r") as data_file:
data_file_data = json.loads(data_file.read())
data_file_data["rcid"] = 5
+ with open(pathlib.Path(__file__).parent.resolve().parent.resolve().parent.resolve().joinpath("data.json"), "w") as data_file:
data_file.write(json.dumps(data_file_data, indent=4))
# Start mock server
-server.start_mock_server(8080)
+server.start_mock_server(8080, command_args)
# Revert file changes
if not command_args.no_client: