Skip to content

Commit

Permalink
Fixed cli tests to use correct params for call assertion.
Browse files Browse the repository at this point in the history
  • Loading branch information
jezdez committed Aug 3, 2015
1 parent 9b16098 commit 456b26b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/test_cli.py
Expand Up @@ -14,7 +14,7 @@ def setUp(self):
def test_main_should_call_correct_function(self, mock_version):
result = self.runner.invoke(main, ['version'])
self.assertEqual(result.exit_code, 0)
mock_version.assert_called_once_with()
mock_version.assert_called_once_with(noop=False, force_level=None)

@mock.patch('semantic_release.cli.config.getboolean', lambda *x: False)
@mock.patch('semantic_release.cli.tag_new_version')
Expand All @@ -39,21 +39,21 @@ def test_version_should_call_correct_functions(self, mock_current_version, mock_
def test_force_major(self, mock_version):
result = self.runner.invoke(main, ['version', '--major'])
self.assertEqual(result.exit_code, 0)
mock_version.assert_called_once_with()
mock_version.assert_called_once_with(noop=False, force_level='major')
self.assertEqual(mock_version.call_args_list[0][1]['force_level'], 'major')

@mock.patch('semantic_release.cli.version')
def test_force_minor(self, mock_version):
result = self.runner.invoke(main, ['version', '--minor'])
self.assertEqual(result.exit_code, 0)
mock_version.assert_called_once_with()
mock_version.assert_called_once_with(noop=False, force_level='minor')
self.assertEqual(mock_version.call_args_list[0][1]['force_level'], 'minor')

@mock.patch('semantic_release.cli.version')
def test_force_patch(self, mock_version):
result = self.runner.invoke(main, ['version', '--patch'])
self.assertEqual(result.exit_code, 0)
mock_version.assert_called_once_with()
mock_version.assert_called_once_with(noop=False, force_level='patch')
self.assertEqual(mock_version.call_args_list[0][1]['force_level'], 'patch')

@mock.patch('semantic_release.cli.tag_new_version')
Expand Down Expand Up @@ -131,7 +131,7 @@ def test_version_check_build_status_not_called_if_disabled(self, mock_check_buil
def test_publish_should_do_nothing(self, mock_version, mock_push, mock_upload):
result = self.runner.invoke(main, ['publish'])
self.assertEqual(result.exit_code, 0)
mock_version.assert_called_once_with()
mock_version.assert_called_once_with(noop=False, force_level=None)
self.assertFalse(mock_push.called)
self.assertFalse(mock_upload.called)

Expand All @@ -141,6 +141,6 @@ def test_publish_should_do_nothing(self, mock_version, mock_push, mock_upload):
def test_publish_should_call_functions(self, mock_version, mock_push, mock_upload):
result = self.runner.invoke(main, ['publish'])
self.assertEqual(result.exit_code, 0)
mock_version.assert_called_once_with()
mock_version.assert_called_once_with(noop=False, force_level=None)
mock_push.assert_called_once_with()
mock_upload.assert_called_once_with()

0 comments on commit 456b26b

Please sign in to comment.