Skip to content

Commit

Permalink
fix: stray paren in command to describe deployments (#406)
Browse files Browse the repository at this point in the history
  • Loading branch information
joeyAghion committed Mar 29, 2024
1 parent 61856fa commit 9426e0e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion hokusai/services/kubectl.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def contexts(self):

def get_object(self, obj):
''' run kubectl get <object> '''
cmd = self.command(f'get {obj} -o json)')
cmd = self.command(f'get {obj} -o json')
try:
return json.loads(shout(cmd))
except ValueError:
Expand Down
6 changes: 6 additions & 0 deletions test/unit/test_services/test_kubectl.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,13 @@ def it_returns_output(mocker):
obj = Kubectl('staging')
mock_return = { 'foo': 'bar' }
mocker.patch('hokusai.services.kubectl.shout', return_value=json.dumps(mock_return))
spy = mocker.spy(hokusai.services.kubectl, 'shout')
assert obj.get_object('pods') == mock_return
spy.assert_has_calls([
mocker.call(
'/tmp/.local/bin/kubectl --context staging get pods -o json'
)
])
def describe_value_error():
def it_returns_none(mocker, mock_shout_raises):
obj = Kubectl('staging')
Expand Down

0 comments on commit 9426e0e

Please sign in to comment.