diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 90844fd..9ec85da 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -27,9 +27,9 @@ jobs: shell: bash - name: Run integrity checks run: | - pycodestyle --format=pylint rkvst_simplehash unittests - python3 -m pylint rkvst_simplehash unittests - black rkvst_simplehash unittests + pycodestyle --format=pylint datatrails_simplehash unittests + python3 -m pylint datatrails_simplehash unittests + black datatrails_simplehash unittests modified=$(git status -s | wc -l) if [ $modified -gt 0 ] then @@ -39,6 +39,6 @@ jobs: ./scripts/unittests.sh rm -f coverage.xml rm -rf htmlcov - coverage run --branch --source rkvst_simplehash -m unittest -v + coverage run --branch --source datatrails_simplehash -m unittest -v shell: bash diff --git a/Dockerfile-builder b/Dockerfile-builder index 8d9b58d..d222006 100644 --- a/Dockerfile-builder +++ b/Dockerfile-builder @@ -23,7 +23,7 @@ RUN python3 -m pip install --upgrade pip \ ENV USER=builder ENV HOME=/home/${USER} ENV PATH=${HOME}/.local/bin:${PATH} -ENV PYTHONPATH=${HOME}/rkvst_simplehash:${PYTHONPATH} +ENV PYTHONPATH=${HOME}/datatrails_simplehash:${PYTHONPATH} RUN mkdir -p ${HOME} WORKDIR ${HOME} diff --git a/LICENSE b/LICENSE index 3b63e04..9f43b9e 100644 --- a/LICENSE +++ b/LICENSE @@ -1,7 +1,7 @@ MIT License -Copyright (c) 2022 RKVST +Copyright (c) 2023 DataTrails Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.rst b/README.rst index a576631..3a87d8b 100644 --- a/README.rst +++ b/README.rst @@ -1,8 +1,8 @@ .. _readme: -RKVST Simplehash in python -============================ +DataTrails Simplehash in python +================================= Prescribed python code that defines the hashing algorithm for DLT Anchoring. @@ -25,14 +25,14 @@ Use standard python pip utility: .. code:: bash - python3 -m pip install rkvst-simplehash + python3 -m pip install datatrails-simplehash If your version of python3 is too old an error of this type or similar will be emitted: .. note:: - ERROR: Could not find a version that satisfies the requirement rkvst-simplehash (from versions: none) - ERROR: No matching distribution found for rkvst-simplehash + ERROR: Could not find a version that satisfies the requirement datatrails-simplehash (from versions: none) + ERROR: No matching distribution found for datatrails-simplehash Which Version =============== @@ -41,13 +41,13 @@ To Determine which version of the simple hash script to use, i.e. simplehashv1 o look at the response from the `v1alpha2/blockchain` list api and correlate the version with the `hash_schema_version` in the `simple_hash_details` section. -Alternatively look for the SimpleHashInfo section in the rkvst app, found on the transaction page +Alternatively look for the SimpleHashInfo section in the datatrails app, found on the transaction page of a simple hash event, and correlate the version with `schema_version`. Examples ========== -You can then use the code to recreate the simple hash of a list of SIMPLE_HASH events from RKVST. +You can then use the code to recreate the simple hash of a list of SIMPLE_HASH events from DataTrails. Importing in own code ------------------------ @@ -60,7 +60,7 @@ Permissioned Assets V1 """From a list of events. """ - from rkvst_simplehash.v1 import ( + from datatrails_simplehash.v1 import ( anchor_events, SimpleHashError, ) @@ -72,7 +72,7 @@ Permissioned Assets V1 # if any pending events a SimpleHashPendingEventFound error will be thrown # if any of the events do not contain the required field then a SimpleHashFieldMissing error will be thrown api_query = ( - "https://app.rkvst.io" + "https://app.datatrails.ai" "/archivist/v2/assets/-/events" "?proof_mechanism=SIMPLE_HASH" "×tamp_accepted_since=2022-10-07T07:01:34Z" @@ -95,7 +95,7 @@ Permissioned Assets V2 """From a list of events. """ - from rkvst_simplehash.v2 import ( + from datatrails_simplehash.v2 import ( anchor_events, SimpleHashError, ) @@ -107,7 +107,7 @@ Permissioned Assets V2 # if any pending events a SimpleHashPendingEventFound error will be thrown # if any of the events do not contain the required field then a SimpleHashFieldMissing error will be thrown api_query = ( - "https://app.rkvst.io" + "https://app.datatrails.ai" "/archivist/v2/assets/-/events" "?proof_mechanism=SIMPLE_HASH" "×tamp_accepted_since=2022-10-07T07:01:34Z" @@ -130,7 +130,7 @@ Public Assets V1 """From a list of events. """ - from rkvst_simplehash.v1 import ( + from datatrails_simplehash.v1 import ( anchor_events, SimpleHashError, ) @@ -139,7 +139,7 @@ Public Assets V1 # if any pending events a SimpleHashPendingEventFound error will be thrown # if any of the events do not contain the required field then a SimpleHashFieldMissing error will be thrown api_query = ( - "https://app.rkvst.io" + "https://app.datatrails.ai" "/archivist/v2/publicassets/-/events" "?proof_mechanism=SIMPLE_HASH" "×tamp_accepted_since=2022-10-07T07:01:34Z" @@ -162,7 +162,7 @@ Public Assets V2 """From a list of events. """ - from rkvst_simplehash.v2 import ( + from datatrails_simplehash.v2 import ( anchor_events, SimpleHashError, ) @@ -171,7 +171,7 @@ Public Assets V2 # if any pending events a SimpleHashPendingEventFound error will be thrown # if any of the events do not contain the required field then a SimpleHashFieldMissing error will be thrown api_query = ( - "https://app.rkvst.io" + "https://app.datatrails.ai" "/archivist/v2/publicassets/-/events" "?proof_mechanism=SIMPLE_HASH" "×tamp_accepted_since=2022-10-07T07:01:34Z" @@ -207,16 +207,16 @@ Using an auth token directly and for permissioned assets # python3 -m venv simplehash-venv source simplehash-venv/bin/activate - python3 -m pip install -q rkvst_simplehash + python3 -m pip install -q datatrails_simplehash - api_query="https://app.rkvst.io" + api_query="https://app.datatrails.ai" api_query+="/archivist/v2/assets/-/events" api_query+="?proof_mechanism=SIMPLE_HASH" api_query+="×tamp_accepted_since=2022-10-07T07:01:34Z" api_query+="×tamp_accepted_before=2022-10-16T13:14:56Z" api_query+="&order_by=SIMPLEHASHV1" - rkvst_simplehashv1 \ + datatrails_simplehashv1 \ --auth-token-file "credentials/token" \ "${api_query}" @@ -231,16 +231,16 @@ Or for schema version 2: # python3 -m venv simplehash-venv source simplehash-venv/bin/activate - python3 -m pip install -q rkvst_simplehash + python3 -m pip install -q datatrails_simplehash - api_query="https://app.rkvst.io" + api_query="https://app.datatrails.ai" api_query+="/archivist/v2/assets/-/events" api_query+="?proof_mechanism=SIMPLE_HASH" api_query+="×tamp_accepted_since=2022-10-07T07:01:34Z" api_query+="×tamp_accepted_before=2022-10-16T13:14:56Z" api_query+="&order_by=SIMPLEHASHV1" - rkvst_simplehashv2 \ + datatrails_simplehashv2 \ --auth-token-file "credentials/token" \ "${api_query}" @@ -256,9 +256,9 @@ Using a client id and secret and for permissioned assets # python3 -m venv simplehash-venv source simplehash-venv/bin/activate - python3 -m pip install -q rkvst_simplehash + python3 -m pip install -q datatrails_simplehash - api_query="https://app.rkvst.io" + api_query="https://app.datatrails.ai" api_query+="/archivist/v2/assets/-/events" api_query+="?proof_mechanism=SIMPLE_HASH" api_query+="×tamp_accepted_since=2022-10-07T07:01:34Z" @@ -266,7 +266,7 @@ Using a client id and secret and for permissioned assets api_query+="&order_by=SIMPLEHASHV1" CLIENT_ID=$(cat credentials/client_id) - rkvst_simplehashv1 \ + datatrails_simplehashv1 \ --client-id "${CLIENT_ID}" \ --client-secret-file "credentials/client_secret" \ "${api_query}" @@ -282,9 +282,9 @@ Or for schema version 2: # python3 -m venv simplehash-venv source simplehash-venv/bin/activate - python3 -m pip install -q rkvst_simplehash + python3 -m pip install -q datatrails_simplehash - api_query="https://app.rkvst.io" + api_query="https://app.datatrails.ai" api_query+="/archivist/v2/assets/-/events" api_query+="?proof_mechanism=SIMPLE_HASH" api_query+="×tamp_accepted_since=2022-10-07T07:01:34Z" @@ -292,7 +292,7 @@ Or for schema version 2: api_query+="&order_by=SIMPLEHASHV1" CLIENT_ID=$(cat credentials/client_id) - rkvst_simplehashv2 \ + datatrails_simplehashv2 \ --client-id "${CLIENT_ID}" \ --client-secret-file "credentials/client_secret" \ "${api_query}" @@ -309,21 +309,21 @@ Querying the public assets (does not require authentication) # python3 -m venv simplehash-venv source simplehash-venv/bin/activate - python3 -m pip install -q rkvst_simplehash + python3 -m pip install -q datatrails_simplehash start_time = "2022-11-16T00:00:00Z" end_time = "2022-11-17T00:00:00Z" - rkvst_url = "https://app.rkvst.io" + datatrails_url = "https://app.datatrails.ai" endpoint = "archivist/v2/publicassets/-/events" - api_query="https://app.rkvst.io" + api_query="https://app.datatrails.ai" api_query+="/archivist/v2/publicassets/-/events" api_query+="?proof_mechanism=SIMPLE_HASH" api_query+="×tamp_accepted_since=2022-10-07T07:01:34Z" api_query+="×tamp_accepted_before=2022-10-16T13:14:56Z" api_query+="&order_by=SIMPLEHASHV1" - rkvst_simplehashv1 "${api_query}" + datatrails_simplehashv1 "${api_query}" deactivate rm -rf simplehash-venv @@ -336,21 +336,21 @@ Or for schema version 2: # python3 -m venv simplehash-venv source simplehash-venv/bin/activate - python3 -m pip install -q rkvst_simplehash + python3 -m pip install -q datatrails_simplehash start_time = "2022-11-16T00:00:00Z" end_time = "2022-11-17T00:00:00Z" - rkvst_url = "https://app.rkvst.io" + datatrails_url = "https://app.datatrails.ai" endpoint = "archivist/v2/publicassets/-/events" - api_query="https://app.rkvst.io" + api_query="https://app.datatrails.ai" api_query+="/archivist/v2/publicassets/-/events" api_query+="?proof_mechanism=SIMPLE_HASH" api_query+="×tamp_accepted_since=2022-10-07T07:01:34Z" api_query+="×tamp_accepted_before=2022-10-16T13:14:56Z" api_query+="&order_by=SIMPLEHASHV1" - rkvst_simplehashv2 "${api_query}" + datatrails_simplehashv2 "${api_query}" deactivate rm -rf simplehash-venv diff --git a/Taskfile.yml b/Taskfile.yml index 9b1d87e..9a6f708 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -36,8 +36,8 @@ tasks: desc: Check the style, bug and quality of the code cmds: - ./scripts/builder.sh python3 --version - - ./scripts/builder.sh pycodestyle --format=pylint rkvst_simplehash unittests - - ./scripts/builder.sh python3 -m pylint rkvst_simplehash unittests + - ./scripts/builder.sh pycodestyle --format=pylint datatrails_simplehash unittests + - ./scripts/builder.sh python3 -m pylint datatrails_simplehash unittests clean: desc: Clean git repo @@ -48,7 +48,7 @@ tasks: format: desc: Format code using black cmds: - - ./scripts/builder.sh black rkvst_simplehash unittests + - ./scripts/builder.sh black datatrails_simplehash unittests functest: desc: Functionality testing - requires venv diff --git a/rkvst_simplehash/v1.py b/datatrails_simplehash/v1.py similarity index 100% rename from rkvst_simplehash/v1.py rename to datatrails_simplehash/v1.py diff --git a/rkvst_simplehash/v2.py b/datatrails_simplehash/v2.py similarity index 96% rename from rkvst_simplehash/v2.py rename to datatrails_simplehash/v2.py index 125cdad..dc17dc6 100644 --- a/rkvst_simplehash/v2.py +++ b/datatrails_simplehash/v2.py @@ -224,7 +224,11 @@ def main(): # pragma: no cover parser.add_argument( "api_query", type=str, - help=("the api query string in the asset event response."), + help=( + "the api query string in the blockchain response." + " In quotes. e.g. " + '"https://app.datatrails.ai/archivist/v2/publicassets/-/events?order_by=SIMPLEHASHV2"' + ), ) args = parser.parse_args() diff --git a/pyproject.toml b/pyproject.toml index acf823e..32768e2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,7 +9,7 @@ fail_under = 100 enabled = true [tool.pyright] -include = ["rkvst_simplehash"] +include = ["datatrails_simplehash"] [tool.pylint.main] # Analyse import fallback blocks. This can be used to support both Python 2 and 3 diff --git a/scripts/build.sh b/scripts/build.sh index 9045a21..c58f2b7 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -16,4 +16,4 @@ docker build \ --no-cache \ --build-arg VERSION="$1" \ -f Dockerfile-builder \ - -t rkvst-simplehash-python-builder . + -t datatrails-simplehash-python-builder . diff --git a/scripts/builder.sh b/scripts/builder.sh index 8b84e32..488e339 100755 --- a/scripts/builder.sh +++ b/scripts/builder.sh @@ -30,5 +30,5 @@ docker run \ -e TEST_CLIENT_SECRET_FILENAME \ -e TEST_DEBUG \ -e TEST_REFRESH_TOKEN \ - rkvst-simplehash-python-builder \ + datatrails-simplehash-python-builder \ "$@" diff --git a/scripts/functest.sh b/scripts/functest.sh index ade5bca..674ee6d 100755 --- a/scripts/functest.sh +++ b/scripts/functest.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash # -# Manual testing of the rkvst_simplehashv1 command. +# Manual testing of the datatrails_simplehashv1 command. # # 'task venv' to generate virtual environment # @@ -17,33 +17,33 @@ API_QUERY+="&order_by=SIMPLEHASHV1" echo echo Help -rkvst_simplehashv1 -h +datatrails_simplehashv1 -h echo echo "Get using token file" -if [ -n "${RKVST_AUTHTOKEN_FILENAME}" ] +if [ -n "${DATATRAILS_AUTHTOKEN_FILENAME}" ] then - rkvst_simplehashv1 \ - --auth-token-file "${RKVST_AUTHTOKEN_FILENAME}" \ + datatrails_simplehashv1 \ + --auth-token-file "${DATATRAILS_AUTHTOKEN_FILENAME}" \ "${API_QUERY}" else - echo "Cannot use authtoken - please set RKVST_AUTHTOKEN_FILENAME" + echo "Cannot use authtoken - please set DATATRAILS_AUTHTOKEN_FILENAME" fi echo echo "Get using client id and secret" -if [ -n "${RKVST_APPREG_CLIENT}" -a "${RKVST_APPREG_SECRET_FILENAME}" ] +if [ -n "${DATATRAILS_APPREG_CLIENT}" -a "${DATATRAILS_APPREG_SECRET_FILENAME}" ] then - rkvst_simplehashv1 \ - --client-id "${RKVST_APPREG_CLIENT}" \ - --client-secret-file "${RKVST_APPREG_SECRET_FILENAME}" \ + datatrails_simplehashv1 \ + --client-id "${DATATRAILS_APPREG_CLIENT}" \ + --client-secret-file "${DATATRAILS_APPREG_SECRET_FILENAME}" \ "${API_QUERY}" else - echo "Cannot use appregistration - please set RKVST_APPREG_CLIENT" - echo "Cannot use appregistration - please set RKVST_APPREG_SECRET_FILENAME" + echo "Cannot use appregistration - please set DATATRAILS_APPREG_CLIENT" + echo "Cannot use appregistration - please set DATATRAILS_APPREG_SECRET_FILENAME" fi -API_QUERY="https://app.dev-paul-0.wild.jitsuin.io" +API_QUERY="https://app.datatrails.ai" API_QUERY+="/archivist/v2/publicassets/-/events" API_QUERY+="?proof_mechanism=SIMPLE_HASH" API_QUERY+="×tamp_accepted_since=2022-10-07T07:01:34Z" @@ -52,6 +52,6 @@ API_QUERY+="&order_by=SIMPLEHASHV1" echo echo "Get public assets" -rkvst_simplehashv1 "${API_QUERY}" +datatrails_simplehashv1 "${API_QUERY}" deactivate diff --git a/scripts/unittests.sh b/scripts/unittests.sh index 97f9295..0ecda20 100755 --- a/scripts/unittests.sh +++ b/scripts/unittests.sh @@ -8,7 +8,7 @@ rm -f coverage.xml rm -rf htmlcov COVERAGE="coverage" ${COVERAGE} --version -${COVERAGE} run --branch --source rkvst_simplehash -m unittest -v +${COVERAGE} run --branch --source datatrails_simplehash -m unittest -v ${COVERAGE} html ${COVERAGE} xml ${COVERAGE} report diff --git a/scripts/venv.sh b/scripts/venv.sh index 65812d2..2b3deba 100755 --- a/scripts/venv.sh +++ b/scripts/venv.sh @@ -1,11 +1,11 @@ #!/usr/bin/env bash # -# Create virtualenv the rkvst_simplehashv1 command. +# Create virtualenv the datatrails_simplehashv1 command. # # 'task wheel' to generate installable wheel package generated locally. # rm -rf simplehash-venv/ python3 -m venv simplehash-venv source simplehash-venv/bin/activate -python3 -m pip install -q --force-reinstall dist/rkvst_simplehash-*.whl +python3 -m pip install -q --force-reinstall dist/datatrails_simplehash-*.whl deactivate diff --git a/setup.cfg b/setup.cfg index d714f40..8129a70 100644 --- a/setup.cfg +++ b/setup.cfg @@ -4,15 +4,15 @@ statistics = True max-line-length = 88 [metadata] -name = rkvst-simplehash -author = RKVST Inc. -author_email = support@rkvst.com -description = RKVST Simplehash algorithm for DLT Anchoring +name = datatrails-simplehash +author = DataTrails Inc. +author_email = support@datatrails.ai +description = DataTrails Simplehash algorithm for DLT Anchoring license = MIT license_files = LICENSE long_description = file: README.rst long_description_content_type = text/x-rst -url = https://github.com/rkvst/rkvst-simplehash-python +url = https://github.com/datatrails/datatrails-simplehash-python classifiers = Development Status :: 4 - Beta @@ -24,20 +24,20 @@ classifiers = Topic :: Utilities project_urls = - Source = https://github.com/rkvst/rkvst-simplehash-python - Tracker = https://github.com/rkvst/rkvst-simplehash-python/issues + Source = https://github.com/datatrails/datatrails-simplehash-python + Tracker = https://github.com/datatrails/datatrails-simplehash-python/issues [options] install_requires = file: requirements.txt -packages = rkvst_simplehash +packages = datatrails_simplehash platforms = any python_requires = >=3.8 setup_requires = setuptools-git-versioning [options.entry_points] console_scripts = - rkvst_simplehashv1 = rkvst_simplehash.v1:main - rkvst_simplehashv2 = rkvst_simplehash.v2:main + datatrails_simplehashv1 = datatrails_simplehash.v1:main + datatrails_simplehashv2 = datatrails_simplehash.v2:main [bdist_wheel] universal = 1 diff --git a/unittests/constants.py b/unittests/constants.py index 3d1a968..3ca4aad 100644 --- a/unittests/constants.py +++ b/unittests/constants.py @@ -8,7 +8,7 @@ # The latest timestamp_accepted in any mock event MAX_ACCEPTED = "2022-10-16T13:14:56Z" -URL = "https://app.rkvst-test.io" +URL = "https://app.datatrails-test.ai" PATH = "archivist/v2/assets/-/events" PUBLICPATH = "archivist/v2/publicassets/-/events" API_QUERY = ( diff --git a/unittests/testanchoreventsv1.py b/unittests/testanchoreventsv1.py index f752b12..976ba27 100644 --- a/unittests/testanchoreventsv1.py +++ b/unittests/testanchoreventsv1.py @@ -6,7 +6,7 @@ from requests import RequestException -from rkvst_simplehash.v1 import ( +from datatrails_simplehash.v1 import ( DEFAULT_PAGE_SIZE, TIMEOUT, anchor_events as v1_anchor_events, @@ -42,7 +42,7 @@ class TestHashEventsV1(TestCase): maxDiff = None - @mock.patch("rkvst_simplehash.v1.requests_get") + @mock.patch("datatrails_simplehash.v1.requests_get") def test_anchor_events_v1(self, mock_get): """ Test anchor_events @@ -74,7 +74,7 @@ def test_anchor_events_v1(self, mock_get): msg="GET method called incorrectly", ) - @mock.patch("rkvst_simplehash.v1.requests_get") + @mock.patch("datatrails_simplehash.v1.requests_get") def test_anchor_events_v1_public(self, mock_get): """ Test anchor_events @@ -105,7 +105,7 @@ def test_anchor_events_v1_public(self, mock_get): msg="GET method called incorrectly", ) - @mock.patch("rkvst_simplehash.v1.requests_get") + @mock.patch("datatrails_simplehash.v1.requests_get") def test_anchor_events_v1_paging(self, mock_get): """ Test anchor_events @@ -150,7 +150,7 @@ def test_anchor_events_v1_paging(self, mock_get): msg="GET method called incorrectly", ) - @mock.patch("rkvst_simplehash.v1.requests_get") + @mock.patch("datatrails_simplehash.v1.requests_get") def test_anchor_events_v1_with_pending_event(self, mock_get): """ Test anchor_events @@ -160,7 +160,7 @@ def test_anchor_events_v1_with_pending_event(self, mock_get): with self.assertRaises(SimpleHashPendingEventFound): dummy = v1_anchor_events(API_QUERY, auth_token=AUTH_TOKEN) - @mock.patch("rkvst_simplehash.v1.requests_get") + @mock.patch("datatrails_simplehash.v1.requests_get") def test_anchor_events_v1_with_no_events(self, mock_get): """ Test anchor_events with no events @@ -174,7 +174,7 @@ def test_anchor_events_v1_with_no_events(self, mock_get): msg="Hash has incorrect value", ) - @mock.patch("rkvst_simplehash.v1.requests_get") + @mock.patch("datatrails_simplehash.v1.requests_get") def test_anchor_events_v1_with_missing_events(self, mock_get): """ Test anchor_events with missing events @@ -184,7 +184,7 @@ def test_anchor_events_v1_with_missing_events(self, mock_get): with self.assertRaises(SimpleHashFieldError): dummy = v1_anchor_events(API_QUERY, auth_token=AUTH_TOKEN) - @mock.patch("rkvst_simplehash.v1.requests_get") + @mock.patch("datatrails_simplehash.v1.requests_get") def test_anchor_events_v1_with_incomplete_event(self, mock_get): """ Test anchor_events with incomplete event @@ -194,7 +194,7 @@ def test_anchor_events_v1_with_incomplete_event(self, mock_get): with self.assertRaises(SimpleHashFieldMissing): dummy = v1_anchor_events(API_QUERY, auth_token=AUTH_TOKEN) - @mock.patch("rkvst_simplehash.v1.requests_get") + @mock.patch("datatrails_simplehash.v1.requests_get") def test_anchor_events_v1_with_no_confirmation_status(self, mock_get): """ Test anchor_events with no confirmation status @@ -204,7 +204,7 @@ def test_anchor_events_v1_with_no_confirmation_status(self, mock_get): with self.assertRaises(SimpleHashFieldMissing): dummy = v1_anchor_events(API_QUERY, auth_token=AUTH_TOKEN) - @mock.patch("rkvst_simplehash.v1.requests_get") + @mock.patch("datatrails_simplehash.v1.requests_get") def test_anchor_events_v1_with_requests_exception(self, mock_get): """ Test anchor_events diff --git a/unittests/testanchoreventsv2.py b/unittests/testanchoreventsv2.py index b7dd6b8..015dabc 100644 --- a/unittests/testanchoreventsv2.py +++ b/unittests/testanchoreventsv2.py @@ -6,7 +6,7 @@ from requests import RequestException -from rkvst_simplehash.v2 import ( +from datatrails_simplehash.v2 import ( DEFAULT_PAGE_SIZE, TIMEOUT, SimpleHashFieldError, @@ -15,7 +15,7 @@ SimpleHashRequestsError, ) -from rkvst_simplehash import v2 +from datatrails_simplehash import v2 from .mock_response import MockResponse @@ -44,7 +44,7 @@ class TestHashEventsV2(TestCase): maxDiff = None - @mock.patch("rkvst_simplehash.v2.requests_get") + @mock.patch("datatrails_simplehash.v2.requests_get") def test_anchor_events_v2(self, mock_get): """ Test anchor_events @@ -76,7 +76,7 @@ def test_anchor_events_v2(self, mock_get): msg="GET method called incorrectly", ) - @mock.patch("rkvst_simplehash.v2.requests_get") + @mock.patch("datatrails_simplehash.v2.requests_get") def test_anchor_events_v2_public(self, mock_get): """ Test anchor_events @@ -107,7 +107,7 @@ def test_anchor_events_v2_public(self, mock_get): msg="GET method called incorrectly", ) - @mock.patch("rkvst_simplehash.v2.requests_get") + @mock.patch("datatrails_simplehash.v2.requests_get") def test_anchor_events_v2_paging(self, mock_get): """ Test anchor_events @@ -152,7 +152,7 @@ def test_anchor_events_v2_paging(self, mock_get): msg="GET method called incorrectly", ) - @mock.patch("rkvst_simplehash.v2.requests_get") + @mock.patch("datatrails_simplehash.v2.requests_get") def test_anchor_events_v_with_pending_event(self, mock_get): """ Test anchor_events @@ -162,7 +162,7 @@ def test_anchor_events_v_with_pending_event(self, mock_get): with self.assertRaises(SimpleHashPendingEventFound): dummy = v2.anchor_events(API_QUERY, auth_token=AUTH_TOKEN) - @mock.patch("rkvst_simplehash.v2.requests_get") + @mock.patch("datatrails_simplehash.v2.requests_get") def test_anchor_events_v2_with_no_events(self, mock_get): """ Test anchor_events with no events @@ -176,7 +176,7 @@ def test_anchor_events_v2_with_no_events(self, mock_get): msg="Hash has incorrect value", ) - @mock.patch("rkvst_simplehash.v2.requests_get") + @mock.patch("datatrails_simplehash.v2.requests_get") def test_anchor_events_v2_with_missing_events(self, mock_get): """ Test anchor_events with missing events @@ -186,7 +186,7 @@ def test_anchor_events_v2_with_missing_events(self, mock_get): with self.assertRaises(SimpleHashFieldError): dummy = v2.anchor_events(API_QUERY, auth_token=AUTH_TOKEN) - @mock.patch("rkvst_simplehash.v2.requests_get") + @mock.patch("datatrails_simplehash.v2.requests_get") def test_anchor_events_v2_with_incomplete_event(self, mock_get): """ Test anchor_events with incomplete event @@ -196,7 +196,7 @@ def test_anchor_events_v2_with_incomplete_event(self, mock_get): with self.assertRaises(SimpleHashFieldMissing): dummy = v2.anchor_events(API_QUERY, auth_token=AUTH_TOKEN) - @mock.patch("rkvst_simplehash.v2.requests_get") + @mock.patch("datatrails_simplehash.v2.requests_get") def test_anchor_events_v2_with_no_confirmation_status(self, mock_get): """ Test anchor_events with no confirmation status @@ -206,7 +206,7 @@ def test_anchor_events_v2_with_no_confirmation_status(self, mock_get): with self.assertRaises(SimpleHashFieldMissing): dummy = v2.anchor_events(API_QUERY, auth_token=AUTH_TOKEN) - @mock.patch("rkvst_simplehash.v2.requests_get") + @mock.patch("datatrails_simplehash.v2.requests_get") def test_anchor_events_v2_with_requests_exception(self, mock_get): """ Test anchor_events diff --git a/unittests/testgetauthtokenv1.py b/unittests/testgetauthtokenv1.py index 22b74d3..0e21b4d 100644 --- a/unittests/testgetauthtokenv1.py +++ b/unittests/testgetauthtokenv1.py @@ -5,7 +5,7 @@ from unittest import TestCase, mock from requests import RequestException -from rkvst_simplehash.v1 import get_auth_token, SimpleHashRequestsError +from datatrails_simplehash.v1 import get_auth_token, SimpleHashRequestsError from .mock_response import MockResponse from .testanchoreventsv1 import API_QUERY @@ -33,7 +33,7 @@ class TestGetAuthTokenV1(TestCase): maxDiff = None - @mock.patch("rkvst_simplehash.v1.requests_post") + @mock.patch("datatrails_simplehash.v1.requests_post") def test_get_auth_token_v1(self, mock_post): """ Test anchor_events @@ -48,7 +48,7 @@ def test_get_auth_token_v1(self, mock_post): args, kwargs = mock_post.call_args self.assertEqual( args, - ("https://app.rkvst-test.io/archivist/iam/v1/appidp/token",), + ("https://app.datatrails-test.ai/archivist/iam/v1/appidp/token",), msg="CREATE auth_token args called incorrectly", ) self.assertEqual( @@ -65,7 +65,7 @@ def test_get_auth_token_v1(self, mock_post): msg="TOKEN method called incorrectly", ) - @mock.patch("rkvst_simplehash.v1.requests_post") + @mock.patch("datatrails_simplehash.v1.requests_post") def test_get_auth_token_request_exception_v1(self, mock_post): """ Test anchor_events diff --git a/unittests/testgetauthtokenv2.py b/unittests/testgetauthtokenv2.py index 723422c..52babd5 100644 --- a/unittests/testgetauthtokenv2.py +++ b/unittests/testgetauthtokenv2.py @@ -5,7 +5,7 @@ from unittest import TestCase, mock from requests import RequestException -from rkvst_simplehash.v2 import get_auth_token, SimpleHashRequestsError +from datatrails_simplehash.v2 import get_auth_token, SimpleHashRequestsError from .mock_response import MockResponse from .testanchoreventsv1 import API_QUERY @@ -33,7 +33,7 @@ class TestGetAuthTokenV2(TestCase): maxDiff = None - @mock.patch("rkvst_simplehash.v2.requests_post") + @mock.patch("datatrails_simplehash.v2.requests_post") def test_get_auth_token_v2(self, mock_post): """ Test anchor_events @@ -48,7 +48,7 @@ def test_get_auth_token_v2(self, mock_post): args, kwargs = mock_post.call_args self.assertEqual( args, - ("https://app.rkvst-test.io/archivist/iam/v1/appidp/token",), + ("https://app.datatrails-test.ai/archivist/iam/v1/appidp/token",), msg="CREATE auth_token args called incorrectly", ) self.assertEqual( @@ -65,7 +65,7 @@ def test_get_auth_token_v2(self, mock_post): msg="TOKEN method called incorrectly", ) - @mock.patch("rkvst_simplehash.v2.requests_post") + @mock.patch("datatrails_simplehash.v2.requests_post") def test_get_auth_token_request_exception_v2(self, mock_post): """ Test anchor_events diff --git a/unittests/testredacteventsv1.py b/unittests/testredacteventsv1.py index c8a5b0d..b328a38 100644 --- a/unittests/testredacteventsv1.py +++ b/unittests/testredacteventsv1.py @@ -5,7 +5,7 @@ from unittest import TestCase -from rkvst_simplehash.v1 import ( +from datatrails_simplehash.v1 import ( redact_event, ) diff --git a/unittests/testredacteventsv2.py b/unittests/testredacteventsv2.py index 6aca86c..74c9033 100644 --- a/unittests/testredacteventsv2.py +++ b/unittests/testredacteventsv2.py @@ -5,7 +5,7 @@ from unittest import TestCase -from rkvst_simplehash.v2 import ( +from datatrails_simplehash.v2 import ( redact_event, )