Esempio n. 1
0
 def main(self):
     config = self.load_settings()
     push_command(self._curdir,
                  config,
                  update=self.update,
                  version=self.version,
                  files=self.files)
Esempio n. 2
0
def test_push_command_error(mock_api, mock_change_dir,
                            language_response,
                            project_response):
    mock_api.get_languages.return_value = language_response
    mock_api.get_project.return_value = project_response

    with pytest.raises(PatternNotFound):
        push_command(mock_change_dir, {})
Esempio n. 3
0
 def main(self):
     log.info('Loading Qordoba config...')
     config = self.load_settings()
     push_command(self._curdir,
                  config,
                  update=self.update,
                  version=self.version,
                  files=self.files)
Esempio n. 4
0
def test_push_command_update(mock_api, mock_change_dir,
                             mock_update,
                             mock_upload,
                             language_response,
                             project_response):
    mock_api.get_languages.return_value = language_response
    mock_api.get_project.return_value = project_response
    mock_api.page_search.return_value = ('test',)

    push_command(mock_change_dir, {}, update=True, files=(os.path.join(mock_change_dir, 'test.json'),))

    mock_update.assert_called_once()
    mock_upload.assert_not_called()