Пример #1
0
  def test_get_rake_path(self):
    module = FakeAnsibleModule()
    module.get_bin_path = Mock()

    rake = RakeModule(module)
    rake.get_rake_path()

    module.get_bin_path.assert_called_with('rake', True, [])
Пример #2
0
    def test_get_rake_path(self):
        module = FakeAnsibleModule()
        module.get_bin_path = Mock()

        rake = RakeModule(module)
        rake.get_rake_path()

        module.get_bin_path.assert_called_with('rake', True, [])
Пример #3
0
    def test_run_command_with_unchanged_diff_paths(self):
        module = FakeAnsibleModule()
        module.get_bin_path = Mock()
        module.params['path'] = '.'
        module.params['diff_paths'] = [{
            'current': 'test/fixtures/current_db',
            'next': 'text/fixtures/next_db'
        }]
        module.run_command = Mock(return_value=(True, '', ''))

        rake = RakeModule(module)
        rake.run_command('db:migrate')
        module.run_command.assert_not_called()
Пример #4
0
  def test_run_command_with_hanged_diff_paths(self):
    module = FakeAnsibleModule()
    module.get_bin_path = Mock(return_value='/bin/rake')
    module.params['path'] = '.'
    module.params['diff_paths'] = [{
      'current': 'test/fixtures/current_db',
      'next': 'text/fixtures/changed_db'
    }]
    module.run_command = Mock(return_value=(True,'',''))

    rake = RakeModule(module)
    rake.run_command('db:migrate')
    module.run_command.assert_called_with('/bin/rake db:migrate', check_rc=True)