eerste opzet testje

This commit is contained in:
2022-11-03 23:28:14 +01:00
parent 617550614d
commit 3c8d34acdd
+37
View File
@@ -0,0 +1,37 @@
import unittest
import configparser
import praw
import random
import General
class TestTest(unittest.TestCase):
def test_a(self):
self.assertEqual(1, 1)
def test_b(self):
self.assertEqual("ab", "a" + "b")
class TestGeneral(unittest.TestCase):
def setUp(self):
config = configparser.ConfigParser()
config.read('stroopwafel.ini')
self.tokens = config["tokens"]
self.r = praw.Reddit(
user_agent='StroopwafelBot',
client_secret=self.tokens["redditSecret"],
client_id=self.tokens["redditId"]
)
self.r.read_only = True
def test_aww(self):
# Duplicate code is tijdelijk!!!11one
raww = self.r.subreddit('aww+catloaf+tuckedinkitties+babyelephantgifs+babybigcatgifs+blep+holdmynip+gingerkitty+cathighfive+catsstandingup+catsareassholes+eyebleach')
post = raww.top('month', limit=250)
listing = list(post)
random.shuffle(listing)
post = listing[0]
print(post)
self.assertIsInstance(post,praw.models.Submission)
def test_playlist(self):
pass