Skip to content

Commit

Permalink
Merge branch 'main' into development
Browse files Browse the repository at this point in the history
  • Loading branch information
jacalata committed Feb 16, 2024
2 parents 2e04907 + eb0b211 commit d42e037
Show file tree
Hide file tree
Showing 14 changed files with 166 additions and 64 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/check-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ jobs:
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }} on ${{ matrix.os }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -53,6 +53,6 @@ jobs:
# queries: security-extended,security-and-quality

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
4 changes: 2 additions & 2 deletions .github/workflows/generate-metadata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.7'

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ jobs:
OUT_FILE_NAME: tabcmd

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: 3.8

Expand All @@ -66,7 +66,7 @@ jobs:
- name: Validate package for ${{matrix.TARGET}}
run: ./dist/${{ matrix.TARGET }}/${{matrix.OUT_FILE_NAME}}

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.OUT_FILE_NAME }}
path: ./dist/${{ matrix.TARGET }}/${{ matrix.OUT_FILE_NAME }}
4 changes: 2 additions & 2 deletions .github/workflows/publish-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ jobs:
name: Build dist files for PyPi
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: 3.8
- name: Build dist files
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:

steps:
- name: Set up Python ${{ matrix.python-version }} on ${{ matrix.os }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: pip install Tabcmd
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/run-e2-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ jobs:
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }} on ${{ matrix.os }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ jobs:
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }} on ${{ matrix.os }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,6 @@ site-packages
tabcmd-dev
workon
test.junit.xml

# exceptions
!tests/assets/detailed_users.csv
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ dependencies = [
"doit",
"ftfy",
"pyinstaller_versionfile",
"pytest-order",
"requests>=2.25,<3.0",
"setuptools_scm",
"types-appdirs",
Expand Down
1 change: 1 addition & 0 deletions tests/assets/detailed_users.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
jsmith, , "John Smith", , ,
27 changes: 27 additions & 0 deletions tests/commands/test_run_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,33 @@ def test_get_workbook(self, mock_session, mock_server):
get_url_command.GetUrl.run_command(mock_args)
mock_session.assert_called()

def test_publish(self, mock_session, mock_server):
RunCommandsTest._set_up_session(mock_session, mock_server)
mock_args.overwrite = False
mock_args.filename = "existing_file.twbx"
mock_args.project_name = "project-name"
mock_args.parent_project_path = "projects"
mock_args.name = ""
mock_args.tabbed = True
mock_args.db_username = None
mock_args.oauth_username = None
mock_args.append = False
mock_args.replace = False
mock_args.thumbnail_username = None
mock_args.thumbnail_group = None
mock_server.projects = getter
publish_command.PublishCommand.run_command(mock_args)
mock_session.assert_called()

@unittest.skip("target code not implemented yet")
def test_runschedule(self, mock_session, mock_server):
RunCommandsTest._set_up_session(mock_session, mock_server)
mock_server.schedules = getter
mock_args.schedule = "myschedule"
with self.assertRaises(SystemExit):
runschedule_command.RunSchedule.run_command(mock_args)
# mock_session.assert_called()

# extracts
def test_create_extract(self, mock_session, mock_server):
RunCommandsTest._set_up_session(mock_session, mock_server)
Expand Down
2 changes: 0 additions & 2 deletions tests/commands/test_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ def _set_mocks_for_json_file_exists(mock_path, mock_json_lib, does_it_exist=True
mock_json_lib.load.return_value = None
return path


def _set_mock_file_content(mock_load, expected_content):
mock_load.return_value = expected_content
return mock_load
Expand Down Expand Up @@ -121,7 +120,6 @@ def test_json_invalid(self, mock_open, mock_path, mock_json):
test_session = Session()
assert test_session.username is None


@mock.patch("getpass.getpass")
class BuildCredentialsTests(unittest.TestCase):
@classmethod
Expand Down
Loading

0 comments on commit d42e037

Please sign in to comment.