From f653e53bf02c556a0e8070916955aae5ab3f4bc9 Mon Sep 17 00:00:00 2001 From: Harmon Date: Wed, 3 Nov 2021 16:40:08 -0500 Subject: [PATCH] Update config import in tests Also improve formatting in tests --- tests/test_api.py | 2 +- tests/test_auth.py | 2 +- tests/test_client.py | 3 ++- tests/test_cursors.py | 2 +- tests/test_rate_limit.py | 3 ++- tests/test_resultset.py | 8 +++++--- 6 files changed, 12 insertions(+), 8 deletions(-) diff --git a/tests/test_api.py b/tests/test_api.py index 979f3ef..d0543b6 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -4,7 +4,7 @@ import time import unittest from ast import literal_eval -from tests.config import tape, TweepyTestCase, username +from config import tape, TweepyTestCase, username from tweepy import API, FileCache, MemoryCache from tweepy.models import Friendship from tweepy.parsers import Parser diff --git a/tests/test_auth.py b/tests/test_auth.py index 4283ccf..29ea4ab 100644 --- a/tests/test_auth.py +++ b/tests/test_auth.py @@ -1,7 +1,7 @@ import random import unittest -from tests.config import * +from config import * from tweepy import API, OAuthHandler diff --git a/tests/test_client.py b/tests/test_client.py index 66bef3c..d92c7ec 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -1,11 +1,12 @@ import unittest -from tests.config import ( +from config import ( access_token, access_token_secret, bearer_token, consumer_key, consumer_secret, tape, user_id ) import tweepy + class TweepyTestCase(unittest.TestCase): def setUp(self): diff --git a/tests/test_cursors.py b/tests/test_cursors.py index 658f28f..e5898df 100644 --- a/tests/test_cursors.py +++ b/tests/test_cursors.py @@ -1,4 +1,4 @@ -from tests.config import tape, TweepyTestCase, username +from config import tape, TweepyTestCase, username from tweepy import Cursor diff --git a/tests/test_rate_limit.py b/tests/test_rate_limit.py index 6a62612..c57c6cf 100644 --- a/tests/test_rate_limit.py +++ b/tests/test_rate_limit.py @@ -1,10 +1,11 @@ import os import unittest -from tests.config import create_auth +from config import create_auth from tweepy import API from tweepy.errors import HTTPException + testratelimit = 'TEST_RATE_LIMIT' in os.environ diff --git a/tests/test_resultset.py b/tests/test_resultset.py index 66a008e..995e793 100644 --- a/tests/test_resultset.py +++ b/tests/test_resultset.py @@ -1,16 +1,19 @@ -from tests.config import TweepyTestCase - +from config import TweepyTestCase from tweepy.models import ResultSet + class NoIdItem: pass + class IdItem: def __init__(self, id): self.id = id + ids_fixture = [1, 10, 8, 50, 2, 100, 5] + class TweepyResultSetTests(TweepyTestCase): def setUp(self): self.results = ResultSet() @@ -27,4 +30,3 @@ class TweepyResultSetTests(TweepyTestCase): def testsinceid(self): self.assertEqual(self.results.since_id, 100) - -- 2.25.1