From 3c8d34acdd57ec664e392ffec1f8bf5c721ae72a Mon Sep 17 00:00:00 2001 From: Mark Hoekveen Date: Thu, 3 Nov 2022 23:28:14 +0100 Subject: [PATCH] eerste opzet testje --- tests.py | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 tests.py diff --git a/tests.py b/tests.py new file mode 100644 index 0000000..f2c3082 --- /dev/null +++ b/tests.py @@ -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 \ No newline at end of file