create fake world/group instances for testing
This commit is contained in:
4
main.py
4
main.py
@@ -1,9 +1,9 @@
|
|||||||
from vrcapi import getGroupInstances
|
from vrcapi import getGroupInstances, fakeGroupInstances
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
instance_data = []
|
instance_data = []
|
||||||
group_instances = getGroupInstances()
|
group_instances = fakeGroupInstances()
|
||||||
|
|
||||||
for instance in group_instances:
|
for instance in group_instances:
|
||||||
instance_record = {"timestamp": datetime.now(),
|
instance_record = {"timestamp": datetime.now(),
|
||||||
|
29
vrcapi.py
29
vrcapi.py
@@ -3,8 +3,37 @@ from vrchatapi.api import authentication_api
|
|||||||
from vrchatapi.exceptions import UnauthorizedException, ApiException
|
from vrchatapi.exceptions import UnauthorizedException, ApiException
|
||||||
from vrchatapi.models.two_factor_auth_code import TwoFactorAuthCode
|
from vrchatapi.models.two_factor_auth_code import TwoFactorAuthCode
|
||||||
from vrchatapi.models.two_factor_email_code import TwoFactorEmailCode
|
from vrchatapi.models.two_factor_email_code import TwoFactorEmailCode
|
||||||
|
from vrchatapi.models.group_instance import GroupInstance
|
||||||
|
from vrchatapi.models.world import World
|
||||||
from totp import getTOTP
|
from totp import getTOTP
|
||||||
import os
|
import os
|
||||||
|
from random import randint
|
||||||
|
from datetime import datetime
|
||||||
|
|
||||||
|
def fakeGroupInstances():
|
||||||
|
group_instances = []
|
||||||
|
# For testing purposes
|
||||||
|
|
||||||
|
# Worlds API object that is valid enough to not cause errors in testing
|
||||||
|
fakeWorld = World(
|
||||||
|
"usr_123TEST-789-abcd-efghi-aaa69420",
|
||||||
|
"McLovin",
|
||||||
|
90,
|
||||||
|
50,
|
||||||
|
datetime.now(),
|
||||||
|
"A test world, it does not exist. No VRC API's were harmed",
|
||||||
|
0, False, 0, "world_AAAA-TEST-49494-69420",
|
||||||
|
"http://null.example/hello.jpg", [], "4/20/2020",
|
||||||
|
"Fake world", None, 0, "vrchat", 0, None, 0, 0, "9/11/2021", "public", ["nothing", "testing"],
|
||||||
|
"http://testing.localhost/thisisnotreal.png", [], datetime.now(), 5, 90, [])
|
||||||
|
|
||||||
|
# fake instance
|
||||||
|
fakeInstance1 = GroupInstance("TESTTESTgrp_69420_aaaaaaaaa",
|
||||||
|
"test", fakeWorld, randint(1, 50))
|
||||||
|
|
||||||
|
group_instances.append(fakeInstance1)
|
||||||
|
|
||||||
|
return group_instances
|
||||||
|
|
||||||
def getGroupInstances():
|
def getGroupInstances():
|
||||||
group_instances = []
|
group_instances = []
|
||||||
|
Reference in New Issue
Block a user