jenkins-bot has submitted this change. ( 
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/854415 )

Change subject: [tests] Enable oauth_tests.py
......................................................................

[tests] Enable oauth_tests.py

Change-Id: I7a60a7740d2f756a09e07dac4d4eb1328c43a948
---
M .github/workflows/oauth_tests-ci.yml
M tests/__init__.py
M tests/oauth_tests.py
3 files changed, 5 insertions(+), 12 deletions(-)

Approvals:
  Xqt: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/.github/workflows/oauth_tests-ci.yml 
b/.github/workflows/oauth_tests-ci.yml
index 465cdb7..09dec5f 100644
--- a/.github/workflows/oauth_tests-ci.yml
+++ b/.github/workflows/oauth_tests-ci.yml
@@ -69,7 +69,6 @@
       uses: jungwinter/split@v2
       id: split
       with:
-        # msg: ${{ env._oauth_token_val }}
         msg: ${{ secrets[format('{0}', steps.token.outputs.uppercase)] }}
         separator: ":"

@@ -98,15 +97,15 @@
         echo "noisysleep = float('inf')" >> user-config.py
         echo "maximum_GET_length = 5000" >> user-config.py
         echo "console_encoding = 'utf8'" >> user-config.py
-        echo "import os" >> user-config.py
-        echo "password_file = os.path.expanduser('passwordfile')" >> 
user-config.py
-        echo "('${{ env.PYWIKIBOT_USERNAME }}', '${{ 
secrets.PYWIKIBOT_OAUTHPWD }}')" > passwordfile

     - name: Test with unittest
       timeout-minutes: 1
+      env:
+        ${{ steps.token.outputs.uppercase }}: ${{ secrets[format('{0}', 
steps.token.outputs.uppercase)] }}
       run: |
         python pwb.py version
         coverage run -m unittest -vv tests/site_login_logout_tests.py
+        coverage run -m unittest -vv tests/oauth_tests.py

     - name: Upload coverage to Codecov
       run: codecov
\ No newline at end of file
diff --git a/tests/__init__.py b/tests/__init__.py
index 5b2b952..c4b9b3c 100644
--- a/tests/__init__.py
+++ b/tests/__init__.py
@@ -104,7 +104,6 @@
     'memento',
     'mysql',
     'namespace',
-    'oauth',
     'page',
     'pagegenerators',
     'paraminfo',
diff --git a/tests/oauth_tests.py b/tests/oauth_tests.py
index 2885c98..242c126 100755
--- a/tests/oauth_tests.py
+++ b/tests/oauth_tests.py
@@ -26,7 +26,7 @@

     def _get_oauth_tokens(self):
         """Get valid OAuth tokens from environment variables."""
-        tokens_env = 'OAUTH_TOKENS_' + self.family.upper()
+        tokens_env = 'OAUTH_TOKEN_' + self.family.upper()
         tokens = os.environ.get(tokens_env + '_' + self.code.upper())
         tokens = tokens or os.environ.get(tokens_env)
         return tuple(tokens.split(':')) if tokens is not None else None
@@ -45,12 +45,7 @@
         self.access_token = tokens[2:]


-class DefaultOAuthSiteTestCase(DefaultSiteTestCase, OAuthSiteTestCase):
-
-    """Default OAuth site test."""
-
-
-class TestOauthLoginManger(DefaultOAuthSiteTestCase):
+class TestOauthLoginManger(DefaultSiteTestCase, OAuthSiteTestCase):

     """Test OAuth login manager."""


--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/854415
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.wikimedia.org/r/settings

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I7a60a7740d2f756a09e07dac4d4eb1328c43a948
Gerrit-Change-Number: 854415
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <[email protected]>
Gerrit-Reviewer: Xqt <[email protected]>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged
_______________________________________________
Pywikibot-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to