Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Azzouz-Thuderoz committed Jan 12, 2024
2 parents b57ccbb + 01e1046 commit 831c13d
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ on:

permissions:
contents: read
env:
OAI_BASIC_PASSWORD: ${{ secrets.OAI_BASIC_PASSWORD }}

jobs:
build:
Expand Down
10 changes: 10 additions & 0 deletions src/zbmath_rest2oai/oai_connection.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import os

import requests
from requests.auth import HTTPBasicAuth


def get_version():
basic = HTTPBasicAuth('swmath', os.environ.get('OAI_BASIC_PASSWORD'))
res = requests.get('https://oai-input.portal.mardi4nfdi.de/oai-backend/info/version', auth=basic)
return res.text
13 changes: 13 additions & 0 deletions tests/oai_connect_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import unittest

from zbmath_rest2oai import oai_connection


class PlainXmlTest(unittest.TestCase):
def test_similarity(self):
real_string = oai_connection.get_version()
self.assertEqual("1.2.8", real_string)


if __name__ == '__main__':
unittest.main()

0 comments on commit 831c13d

Please sign in to comment.