Skip to content
This repository was archived by the owner on Mar 14, 2023. It is now read-only.

Commit e9df28e

Browse files
committed
fix tests
1 parent b20a8aa commit e9df28e

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

highfive/newpr.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,11 @@ def __init__(self, payload, config, config_dir=None):
5555

5656
self.repo_config = self.load_repo_config(config_dir)
5757

58-
def load_repo_config(self, config_dir):
58+
def load_repo_config(self, config_dir=None):
5959
'''Load the repository configuration.'''
6060
(org, repo) = self.payload['repository', 'full_name'].split('/')
6161
try:
62-
return self._load_json_file(config_dir, os.path.join(org, repo) + '.json')
62+
return self._load_json_file(os.path.join(org, repo) + '.json', config_dir)
6363
except IOError:
6464
raise UnsupportedRepoError
6565

@@ -75,7 +75,7 @@ def run(self, event):
7575
else:
7676
return 'Unsupported webhook event.\n'
7777

78-
def _load_json_file(self, config_dir, name):
78+
def _load_json_file(self, name, config_dir=None):
7979
if not config_dir:
8080
config_dir = os.path.join(os.path.dirname(__file__), 'configs')
8181

highfive/tests/test_newpr.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def test_load_repo_config_supported(self, mock_load_json_file):
8484
m.stop_patchers()
8585
assert m.handler.load_repo_config() == {'a': 'config!'}
8686
mock_load_json_file.assert_called_once_with(
87-
os.path.join('foo', 'blah.json')
87+
os.path.join('foo', 'blah.json'), None,
8888
)
8989

9090
@mock.patch('highfive.newpr.HighfiveHandler._load_json_file')
@@ -99,7 +99,7 @@ def test_load_repo_config_unsupported(self, mock_load_json_file):
9999
with pytest.raises(newpr.UnsupportedRepoError):
100100
m.handler.load_repo_config()
101101
mock_load_json_file.assert_called_once_with(
102-
os.path.join('foo', 'blah.json')
102+
os.path.join('foo', 'blah.json'), None
103103
)
104104

105105
class TestNewPRGeneral(TestNewPR):

0 commit comments

Comments
 (0)