diff --git a/ogr/services/gitlab/project.py b/ogr/services/gitlab/project.py index 40c8b0f0..b7889d14 100644 --- a/ogr/services/gitlab/project.py +++ b/ogr/services/gitlab/project.py @@ -2,6 +2,7 @@ # SPDX-License-Identifier: MIT import logging +import os from typing import Any, Optional, Union import gitlab @@ -361,6 +362,8 @@ def get_branches(self) -> list[str]: def get_file_content(self, path, ref=None) -> str: ref = ref or self.default_branch + # GitLab cannot resolve './' + path = os.path.normpath(path) try: file = self.gitlab_repo.files.get(file_path=path, ref=ref) return file.decode().decode() diff --git a/tests/integration/gitlab/test_data/test_generic_commands/GenericCommands.test_get_file_content_resolve_dot.yaml b/tests/integration/gitlab/test_data/test_generic_commands/GenericCommands.test_get_file_content_resolve_dot.yaml new file mode 100644 index 00000000..37fb12d6 --- /dev/null +++ b/tests/integration/gitlab/test_data/test_generic_commands/GenericCommands.test_get_file_content_resolve_dot.yaml @@ -0,0 +1,619 @@ +_requre: + DataTypes: 1 + key_strategy: StorageKeysInspectSimple + version_storage_file: 2 +requests.sessions: + send: + GET: + https://gitlab.com/api/v4/projects/14233409/repository/files/README.md?ref=b8e18207cfdad954f1b3a96db34d0706b272e6cf: &new_request + - metadata: + latency: 0.30714845657348633 + module_call_list: + - unittest.case + - requre.online_replacing + - tests.integration.gitlab.test_generic_commands + - ogr.services.gitlab.project + - gitlab.cli + - gitlab.v4.objects + - gitlab.exceptions + - gitlab.mixins + - gitlab + - requre.objects + - requre.cassette + - requests.sessions + - send + output: + __store_indicator: 2 + _content: + blob_id: e2e4fde810a779db69c2ecb2b90863a7ea7507ac + commit_id: b8e18207cfdad954f1b3a96db34d0706b272e6cf + content: IyBvZ3ItdGVzdHMKClRlc3RpbmcgcmVwb3NpdG9yeSBmb3IgcHl0aG9uLW9nciBwYWNrYWdlLiB8IGh0dHBzOi8vZ2l0aHViLmNvbS9wYWNraXQtc2VydmljZS9vZ3IKCnRlc3QxCnRlc3QyCg== + content_sha256: 89db43e799da0b6a4a4190e3440c6af50a557d1a4a780997bbbce1a201842d6b + encoding: base64 + file_name: README.md + file_path: README.md + last_commit_id: 59b1a9bab5b5198c619270646410867788685c16 + ref: b8e18207cfdad954f1b3a96db34d0706b272e6cf + size: 109 + _next: null + elapsed: 0.2 + encoding: null + headers: + CF-Cache-Status: DYNAMIC + CF-RAY: 5c94b66fca8b0d6b-VIE + Cache-Control: max-age=0, private, must-revalidate + Connection: keep-alive + Content-Encoding: gzip + Content-Type: application/json + Date: Fri, 01 Nov 2019 13-36-03 GMT + Etag: W/"003d2eca7a0a430e4911005e1086dac3" + Expect-CT: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" + GitLab-LB: fe-09-lb-gprd + GitLab-SV: localhost + RateLimit-Limit: '600' + RateLimit-Observed: '27' + RateLimit-Remaining: '573' + RateLimit-Reset: '1598520044' + RateLimit-ResetTime: Thu, 27 Aug 2020 09:20:44 GMT + Referrer-Policy: strict-origin-when-cross-origin + Server: cloudflare + Strict-Transport-Security: max-age=31536000 + Transfer-Encoding: chunked + Vary: Accept-Encoding, Origin + X-Content-Type-Options: nosniff + X-Frame-Options: SAMEORIGIN + X-Gitlab-Blob-Id: e2e4fde810a779db69c2ecb2b90863a7ea7507ac + X-Gitlab-Commit-Id: b8e18207cfdad954f1b3a96db34d0706b272e6cf + X-Gitlab-Content-Sha256: 89db43e799da0b6a4a4190e3440c6af50a557d1a4a780997bbbce1a201842d6b + X-Gitlab-Encoding: base64 + X-Gitlab-File-Name: README.md + X-Gitlab-File-Path: README.md + X-Gitlab-Last-Commit-Id: 59b1a9bab5b5198c619270646410867788685c16 + X-Gitlab-Ref: b8e18207cfdad954f1b3a96db34d0706b272e6cf + X-Gitlab-Size: '109' + X-Request-Id: YNjQyD4wrE4 + X-Runtime: '0.070633' + cf-request-id: 04d0d059d800000d6b8a25d200000001 + raw: !!binary "" + reason: OK + status_code: 200 + - metadata: + latency: 0.22492265701293945 + module_call_list: + - unittest.case + - requre.online_replacing + - tests.integration.gitlab.test_generic_commands + - ogr.services.gitlab.project + - gitlab.cli + - gitlab.v4.objects + - gitlab.exceptions + - gitlab.mixins + - gitlab + - requre.objects + - requre.cassette + - requests.sessions + - send + output: + __store_indicator: 2 + _content: + blob_id: e2e4fde810a779db69c2ecb2b90863a7ea7507ac + commit_id: b8e18207cfdad954f1b3a96db34d0706b272e6cf + content: IyBvZ3ItdGVzdHMKClRlc3RpbmcgcmVwb3NpdG9yeSBmb3IgcHl0aG9uLW9nciBwYWNrYWdlLiB8IGh0dHBzOi8vZ2l0aHViLmNvbS9wYWNraXQtc2VydmljZS9vZ3IKCnRlc3QxCnRlc3QyCg== + content_sha256: 89db43e799da0b6a4a4190e3440c6af50a557d1a4a780997bbbce1a201842d6b + encoding: base64 + file_name: README.md + file_path: README.md + last_commit_id: 59b1a9bab5b5198c619270646410867788685c16 + ref: b8e18207cfdad954f1b3a96db34d0706b272e6cf + size: 109 + _next: null + elapsed: 0.2 + encoding: null + headers: + CF-Cache-Status: DYNAMIC + CF-RAY: 5cb5676fcc8ecbb4-VIE + Cache-Control: max-age=0, private, must-revalidate + Connection: keep-alive + Content-Encoding: gzip + Content-Type: application/json + Date: Fri, 01 Nov 2019 13-36-03 GMT + Etag: W/"003d2eca7a0a430e4911005e1086dac3" + Expect-CT: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" + GitLab-LB: fe-07-lb-gprd + GitLab-SV: localhost + RateLimit-Limit: '600' + RateLimit-Observed: '39' + RateLimit-Remaining: '561' + RateLimit-Reset: '1598862838' + RateLimit-ResetTime: Mon, 31 Aug 2020 08:33:58 GMT + Referrer-Policy: strict-origin-when-cross-origin + Server: cloudflare + Strict-Transport-Security: max-age=31536000 + Transfer-Encoding: chunked + Vary: Accept-Encoding, Origin + X-Content-Type-Options: nosniff + X-Frame-Options: SAMEORIGIN + X-Gitlab-Blob-Id: e2e4fde810a779db69c2ecb2b90863a7ea7507ac + X-Gitlab-Commit-Id: b8e18207cfdad954f1b3a96db34d0706b272e6cf + X-Gitlab-Content-Sha256: 89db43e799da0b6a4a4190e3440c6af50a557d1a4a780997bbbce1a201842d6b + X-Gitlab-Encoding: base64 + X-Gitlab-File-Name: README.md + X-Gitlab-File-Path: README.md + X-Gitlab-Last-Commit-Id: 59b1a9bab5b5198c619270646410867788685c16 + X-Gitlab-Ref: b8e18207cfdad954f1b3a96db34d0706b272e6cf + X-Gitlab-Size: '109' + X-Request-Id: m4bsV4037a1 + X-Runtime: '0.045921' + cf-request-id: 04e53ef9db0000cbb40235b200000001 + raw: !!binary "" + reason: OK + status_code: 200 + https://gitlab.com/api/v4/projects/14233409/repository/files/README%2Emd?ref=b8e18207cfdad954f1b3a96db34d0706b272e6cf: *new_request + https://gitlab.com/api/v4/projects/packit-service%2Fogr-tests: + - metadata: + latency: 0.49857473373413086 + module_call_list: + - unittest.case + - requre.online_replacing + - tests.integration.gitlab.test_generic_commands + - ogr.services.gitlab.project + - gitlab.exceptions + - gitlab.mixins + - gitlab + - requre.objects + - requre.cassette + - requests.sessions + - send + output: + __store_indicator: 2 + _content: + _links: + events: https://gitlab.com/api/v4/projects/14233409/events + issues: https://gitlab.com/api/v4/projects/14233409/issues + labels: https://gitlab.com/api/v4/projects/14233409/labels + members: https://gitlab.com/api/v4/projects/14233409/members + merge_requests: https://gitlab.com/api/v4/projects/14233409/merge_requests + repo_branches: https://gitlab.com/api/v4/projects/14233409/repository/branches + self: https://gitlab.com/api/v4/projects/14233409 + allow_merge_on_skipped_pipeline: null + approvals_before_merge: 0 + archived: false + auto_cancel_pending_pipelines: enabled + auto_devops_deploy_strategy: continuous + auto_devops_enabled: false + autoclose_referenced_issues: true + avatar_url: null + build_coverage_regex: null + build_git_strategy: fetch + build_timeout: 3600 + builds_access_level: enabled + can_create_merge_request_in: true + ci_config_path: null + ci_default_git_depth: 50 + compliance_frameworks: [] + container_registry_enabled: true + created_at: '2019-09-10T10:28:09.946Z' + creator_id: 433670 + default_branch: master + description: Testing repository for python-ogr package. | https://github.com/packit-service/ogr + emails_disabled: null + empty_repo: false + external_authorization_classification_label: '' + forking_access_level: enabled + forks_count: 4 + http_url_to_repo: https://gitlab.com/packit-service/ogr-tests.git + id: 14233409 + import_error: null + import_status: none + issues_access_level: enabled + issues_enabled: true + jobs_enabled: true + last_activity_at: '2020-08-27T09:19:40.071Z' + lfs_enabled: true + marked_for_deletion_at: null + marked_for_deletion_on: null + merge_method: merge + merge_requests_access_level: enabled + merge_requests_enabled: true + mirror: false + name: ogr-tests + name_with_namespace: packit-service / ogr-tests + namespace: + avatar_url: /uploads/-/system/group/avatar/6032704/packit-logo.png + full_path: packit-service + id: 6032704 + kind: group + name: packit-service + parent_id: null + path: packit-service + web_url: https://gitlab.com/groups/packit-service + only_allow_merge_if_all_discussions_are_resolved: false + only_allow_merge_if_pipeline_succeeds: false + open_issues_count: 51 + packages_enabled: true + pages_access_level: enabled + path: ogr-tests + path_with_namespace: packit-service/ogr-tests + permissions: + group_access: + access_level: 40 + notification_level: 3 + project_access: null + printing_merge_request_link_enabled: true + public_jobs: true + readme_url: https://gitlab.com/packit-service/ogr-tests/-/blob/master/README.md + remove_source_branch_after_merge: null + repository_access_level: enabled + request_access_enabled: false + resolve_outdated_diff_discussions: false + runners_token: VjGdzzwZbsTY37sxUeWL + service_desk_address: incoming+packit-service-ogr-tests-14233409-issue-@incoming.gitlab.com + service_desk_enabled: true + shared_runners_enabled: true + shared_with_groups: [] + snippets_access_level: enabled + snippets_enabled: true + ssh_url_to_repo: git@gitlab.com:packit-service/ogr-tests.git + star_count: 0 + suggestion_commit_message: null + tag_list: [] + visibility: public + web_url: https://gitlab.com/packit-service/ogr-tests + wiki_access_level: enabled + wiki_enabled: true + _next: null + elapsed: 0.2 + encoding: null + headers: + CF-Cache-Status: DYNAMIC + CF-RAY: 5c94b66cad8e0d6b-VIE + Cache-Control: max-age=0, private, must-revalidate + Connection: keep-alive + Content-Encoding: gzip + Content-Type: application/json + Date: Fri, 01 Nov 2019 13-36-03 GMT + Etag: W/"689cda9e6c8445468488b00d8112c645" + Expect-CT: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" + GitLab-LB: fe-06-lb-gprd + GitLab-SV: localhost + RateLimit-Limit: '600' + RateLimit-Observed: '26' + RateLimit-Remaining: '574' + RateLimit-Reset: '1598520044' + RateLimit-ResetTime: Thu, 27 Aug 2020 09:20:44 GMT + Referrer-Policy: strict-origin-when-cross-origin + Server: cloudflare + Strict-Transport-Security: max-age=31536000 + Transfer-Encoding: chunked + Vary: Accept-Encoding, Origin + X-Content-Type-Options: nosniff + X-Frame-Options: SAMEORIGIN + X-Request-Id: NbgAV4F9ku7 + X-Runtime: '0.255240' + cf-request-id: 04d0d057e600000d6b8a231200000001 + raw: !!binary "" + reason: OK + status_code: 200 + - metadata: + latency: 0.24662351608276367 + module_call_list: + - unittest.case + - requre.online_replacing + - tests.integration.gitlab.test_generic_commands + - ogr.services.gitlab.project + - gitlab.exceptions + - gitlab.mixins + - gitlab + - requre.objects + - requre.cassette + - requests.sessions + - send + output: + __store_indicator: 2 + _content: + _links: + events: https://gitlab.com/api/v4/projects/14233409/events + issues: https://gitlab.com/api/v4/projects/14233409/issues + labels: https://gitlab.com/api/v4/projects/14233409/labels + members: https://gitlab.com/api/v4/projects/14233409/members + merge_requests: https://gitlab.com/api/v4/projects/14233409/merge_requests + repo_branches: https://gitlab.com/api/v4/projects/14233409/repository/branches + self: https://gitlab.com/api/v4/projects/14233409 + allow_merge_on_skipped_pipeline: null + approvals_before_merge: 0 + archived: false + auto_cancel_pending_pipelines: enabled + auto_devops_deploy_strategy: continuous + auto_devops_enabled: false + autoclose_referenced_issues: true + avatar_url: null + build_coverage_regex: null + build_git_strategy: fetch + build_timeout: 3600 + builds_access_level: enabled + can_create_merge_request_in: true + ci_config_path: null + ci_default_git_depth: 50 + compliance_frameworks: [] + container_registry_enabled: true + created_at: '2019-09-10T10:28:09.946Z' + creator_id: 433670 + default_branch: master + description: Testing repository for python-ogr package. | https://github.com/packit-service/ogr + emails_disabled: null + empty_repo: false + external_authorization_classification_label: '' + forking_access_level: enabled + forks_count: 4 + http_url_to_repo: https://gitlab.com/packit-service/ogr-tests.git + id: 14233409 + import_error: null + import_status: none + issues_access_level: enabled + issues_enabled: true + jobs_enabled: true + last_activity_at: '2020-08-31T08:32:55.070Z' + lfs_enabled: true + marked_for_deletion_at: null + marked_for_deletion_on: null + merge_method: merge + merge_requests_access_level: enabled + merge_requests_enabled: true + mirror: false + name: ogr-tests + name_with_namespace: packit-service / ogr-tests + namespace: + avatar_url: /uploads/-/system/group/avatar/6032704/packit-logo.png + full_path: packit-service + id: 6032704 + kind: group + name: packit-service + parent_id: null + path: packit-service + web_url: https://gitlab.com/groups/packit-service + only_allow_merge_if_all_discussions_are_resolved: false + only_allow_merge_if_pipeline_succeeds: false + open_issues_count: 54 + packages_enabled: true + pages_access_level: enabled + path: ogr-tests + path_with_namespace: packit-service/ogr-tests + permissions: + group_access: + access_level: 40 + notification_level: 3 + project_access: null + printing_merge_request_link_enabled: true + public_jobs: true + readme_url: https://gitlab.com/packit-service/ogr-tests/-/blob/master/README.md + remove_source_branch_after_merge: null + repository_access_level: enabled + request_access_enabled: false + resolve_outdated_diff_discussions: false + runners_token: VjGdzzwZbsTY37sxUeWL + service_desk_address: incoming+packit-service-ogr-tests-14233409-issue-@incoming.gitlab.com + service_desk_enabled: true + shared_runners_enabled: true + shared_with_groups: [] + snippets_access_level: enabled + snippets_enabled: true + ssh_url_to_repo: git@gitlab.com:packit-service/ogr-tests.git + star_count: 0 + suggestion_commit_message: null + tag_list: [] + visibility: public + web_url: https://gitlab.com/packit-service/ogr-tests + wiki_access_level: enabled + wiki_enabled: true + _next: null + elapsed: 0.2 + encoding: null + headers: + CF-Cache-Status: DYNAMIC + CF-RAY: 5cb5676e2a2fcbb4-VIE + Cache-Control: max-age=0, private, must-revalidate + Connection: keep-alive + Content-Encoding: gzip + Content-Type: application/json + Date: Fri, 01 Nov 2019 13-36-03 GMT + Etag: W/"a76f66ccb4c7041a01104cb3af92cc07" + Expect-CT: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" + GitLab-LB: fe-06-lb-gprd + GitLab-SV: localhost + RateLimit-Limit: '600' + RateLimit-Observed: '38' + RateLimit-Remaining: '562' + RateLimit-Reset: '1598862838' + RateLimit-ResetTime: Mon, 31 Aug 2020 08:33:58 GMT + Referrer-Policy: strict-origin-when-cross-origin + Server: cloudflare + Strict-Transport-Security: max-age=31536000 + Transfer-Encoding: chunked + Vary: Accept-Encoding, Origin + X-Content-Type-Options: nosniff + X-Frame-Options: SAMEORIGIN + X-Request-Id: XQmsg9wOeN3 + X-Runtime: '0.069789' + cf-request-id: 04e53ef8db0000cbb402356200000001 + raw: !!binary "" + reason: OK + status_code: 200 + https://gitlab.com/api/v4/user: + - metadata: + latency: 0.3667876720428467 + module_call_list: + - unittest.case + - requre.online_replacing + - tests.integration.gitlab.test_generic_commands + - ogr.services.gitlab.project + - ogr.services.gitlab.service + - gitlab + - gitlab.exceptions + - gitlab.mixins + - gitlab + - requre.objects + - requre.cassette + - requests.sessions + - send + output: + __store_indicator: 2 + _content: + avatar_url: https://assets.gitlab-static.net/uploads/-/system/user/avatar/375555/avatar.png + bio: '' + bio_html: '' + can_create_group: true + can_create_project: true + color_scheme_id: 4 + confirmed_at: '2020-07-24T20:00:33.764Z' + created_at: '2016-01-15T21:12:31.705Z' + current_sign_in_at: '2020-07-24T21:14:08.642Z' + email: matej.focko@outlook.com + external: false + extra_shared_runners_minutes_limit: null + id: 375555 + identities: [] + job_title: '' + last_activity_on: '2020-08-27' + last_sign_in_at: '2020-07-24T20:01:04.051Z' + linkedin: '' + location: "Ko\u0161ice, Slovakia" + name: Matej Focko + organization: '' + private_profile: false + projects_limit: 100000 + public_email: '' + shared_runners_minutes_limit: 2000 + skype: '' + state: active + theme_id: 7 + twitter: MatejFocko + two_factor_enabled: true + username: mfocko + web_url: https://gitlab.com/mfocko + website_url: '' + work_information: null + _next: null + elapsed: 0.2 + encoding: null + headers: + CF-Cache-Status: DYNAMIC + CF-RAY: 5c94b66b1b750d6b-VIE + Cache-Control: max-age=0, private, must-revalidate + Connection: keep-alive + Content-Encoding: gzip + Content-Type: application/json + Date: Fri, 01 Nov 2019 13-36-03 GMT + Etag: W/"dab5631ab3868297f08188ab590f0356" + Expect-CT: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" + GitLab-LB: fe-05-lb-gprd + GitLab-SV: localhost + RateLimit-Limit: '600' + RateLimit-Observed: '25' + RateLimit-Remaining: '575' + RateLimit-Reset: '1598520043' + RateLimit-ResetTime: Thu, 27 Aug 2020 09:20:43 GMT + Referrer-Policy: strict-origin-when-cross-origin + Server: cloudflare + Set-Cookie: __cfduid=da2cffa7af99d574facf42cf097c40e201598519983; expires=Sat, + 26-Sep-20 09:19:43 GMT; path=/; domain=.gitlab.com; HttpOnly; SameSite=Lax; + Secure + Strict-Transport-Security: max-age=31536000 + Transfer-Encoding: chunked + Vary: Accept-Encoding, Origin + X-Content-Type-Options: nosniff + X-Frame-Options: SAMEORIGIN + X-Request-Id: cvRZ3JiLP77 + X-Runtime: '0.024993' + cf-request-id: 04d0d056ec00000d6b8a229200000001 + raw: !!binary "" + reason: OK + status_code: 200 + - metadata: + latency: 0.3189210891723633 + module_call_list: + - unittest.case + - requre.online_replacing + - tests.integration.gitlab.test_generic_commands + - ogr.services.gitlab.project + - ogr.services.gitlab.service + - gitlab + - gitlab.exceptions + - gitlab.mixins + - gitlab + - requre.objects + - requre.cassette + - requests.sessions + - send + output: + __store_indicator: 2 + _content: + avatar_url: https://assets.gitlab-static.net/uploads/-/system/user/avatar/375555/avatar.png + bio: '' + bio_html: '' + can_create_group: true + can_create_project: true + color_scheme_id: 4 + confirmed_at: '2020-07-24T20:00:33.764Z' + created_at: '2016-01-15T21:12:31.705Z' + current_sign_in_at: '2020-08-27T09:28:33.626Z' + email: matej.focko@outlook.com + external: false + extra_shared_runners_minutes_limit: null + id: 375555 + identities: [] + job_title: '' + last_activity_on: '2020-08-31' + last_sign_in_at: '2020-07-24T21:14:08.642Z' + linkedin: '' + location: "Ko\u0161ice, Slovakia" + name: Matej Focko + organization: '' + private_profile: false + projects_limit: 100000 + public_email: '' + shared_runners_minutes_limit: 2000 + skype: '' + state: active + theme_id: 7 + twitter: MatejFocko + two_factor_enabled: true + username: mfocko + web_url: https://gitlab.com/mfocko + website_url: '' + work_information: null + _next: null + elapsed: 0.2 + encoding: null + headers: + CF-Cache-Status: DYNAMIC + CF-RAY: 5cb5676cc8b0cbb4-VIE + Cache-Control: max-age=0, private, must-revalidate + Connection: keep-alive + Content-Encoding: gzip + Content-Type: application/json + Date: Fri, 01 Nov 2019 13-36-03 GMT + Etag: W/"200774d261a50e11c2ad70cff27c4040" + Expect-CT: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" + GitLab-LB: fe-09-lb-gprd + GitLab-SV: localhost + RateLimit-Limit: '600' + RateLimit-Observed: '37' + RateLimit-Remaining: '563' + RateLimit-Reset: '1598862838' + RateLimit-ResetTime: Mon, 31 Aug 2020 08:33:58 GMT + Referrer-Policy: strict-origin-when-cross-origin + Server: cloudflare + Set-Cookie: __cfduid=d809860c60611bc7457365755dc5a06771598862778; expires=Wed, + 30-Sep-20 08:32:58 GMT; path=/; domain=.gitlab.com; HttpOnly; SameSite=Lax; + Secure + Strict-Transport-Security: max-age=31536000 + Transfer-Encoding: chunked + Vary: Accept-Encoding, Origin + X-Content-Type-Options: nosniff + X-Frame-Options: SAMEORIGIN + X-Request-Id: CaG5y5rmGq2 + X-Runtime: '0.023967' + cf-request-id: 04e53ef8010000cbb40234c200000001 + raw: !!binary "" + reason: OK + status_code: 200 diff --git a/tests/integration/gitlab/test_generic_commands.py b/tests/integration/gitlab/test_generic_commands.py index 8c8d49a2..0b7781d6 100644 --- a/tests/integration/gitlab/test_generic_commands.py +++ b/tests/integration/gitlab/test_generic_commands.py @@ -23,6 +23,16 @@ def test_get_file_content(self): "https://github.com/packit-service/ogr\n\ntest1\ntest2\n" ) + def test_get_file_content_resolve_dot(self): + file = self.project.get_file_content( + path="./README.md", + ref="b8e18207cfdad954f1b3a96db34d0706b272e6cf", + ) + assert ( + file == "# ogr-tests\n\nTesting repository for python-ogr package. | " + "https://github.com/packit-service/ogr\n\ntest1\ntest2\n" + ) + def test_request_access(self): project = self.service.get_project( repo="hello-world",