Skip to content

Commit

Permalink
Repo object can now return github attribute
Browse files Browse the repository at this point in the history
* Repo object can now return github attribute

The repository object had a private attribute for github. Added a method to return it which can be used for many things such as fetching branches and pull requests of a repository.

Signed-off-by: AnshulV98 <[email protected]>

* Corrected the unit test to test accurate behavior

Signed-off-by: AnshulV98 <[email protected]>

* Removing python v3.6 as it is deprecated

Signed-off-by: AnshulV98 <[email protected]>

---------

Signed-off-by: AnshulV98 <[email protected]>
  • Loading branch information
AnshulV98 authored Feb 25, 2023
1 parent 6085357 commit 0fe587c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.6, 3.7, 3.8]
python-version: [3.7, 3.8]

steps:
- uses: actions/checkout@v1
Expand Down
3 changes: 3 additions & 0 deletions gordian/repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,3 +246,6 @@ def _get_new_version(self):
elif self.semver_label == 'patch':
patch = str(int(patch) + 1)
self.new_version = '.'.join([major, minor, patch])

def get_github_client(self):
return self._github
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
setup_reqs = ["pytest", "pytest-cov", "pytest-runner", "flake8"]
setuptools.setup(
name="gordian",
version="3.3.0",
version="3.4.0",
author="Intuit",
author_email="[email protected]",
description="A tool to search and replace files in a Git repo",
Expand Down
3 changes: 3 additions & 0 deletions tests/test_repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,3 +150,6 @@ def test__get_new_version_patch(self):
self.repo.semver_label = 'patch'
self.repo._get_new_version()
self.assertEqual(self.repo.new_version, '1.2.4')

def test__get_github_client(self):
self.assertIsNotNone(self.repo.get_github_client)

0 comments on commit 0fe587c

Please sign in to comment.