Skip to content

Commit

Permalink
Merge pull request #50 from ProdPerfect/1.2.8
Browse files Browse the repository at this point in the history
fix failiing workspaces test, attempt to add github test workflow
  • Loading branch information
chdastolfo authored Feb 7, 2022
2 parents 02f695e + 05ba1d6 commit 715e67a
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 1 deletion.
34 changes: 34 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Test

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
python-version: [3.7]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install pipenv
pipenv install --dev
pip install requests
- name: Run Tests
run: |
pip install pytest
pytest
6 changes: 6 additions & 0 deletions monday/query_joins.py
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,7 @@ def get_complexity_query():

return query


def get_workspaces_query():
query = '''
query {
Expand All @@ -484,6 +485,7 @@ def get_workspaces_query():
'''
return query


def create_workspace_query(name, kind, description=""):
query = '''
mutation {
Expand All @@ -495,6 +497,7 @@ def create_workspace_query(name, kind, description=""):
''' % (name, kind, description)
return query


def add_users_to_workspace_query(id, user_ids, kind):
query = '''
mutation {
Expand All @@ -505,6 +508,7 @@ def add_users_to_workspace_query(id, user_ids, kind):
''' % (id, user_ids, kind)
return query


def delete_users_from_workspace_query(id, user_ids):
query = '''
mutation {
Expand All @@ -515,6 +519,7 @@ def delete_users_from_workspace_query(id, user_ids):
''' % (id, user_ids)
return query


def add_teams_to_workspace_query(id, team_ids):
query = '''
mutation {
Expand All @@ -525,6 +530,7 @@ def add_teams_to_workspace_query(id, team_ids):
''' % (id, team_ids)
return query


def delete_teams_from_workspace_query(id, team_ids):
query = '''
mutation {
Expand Down
13 changes: 12 additions & 1 deletion monday/tests/test_workspace_resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,18 @@ def setUp(self):

def test_get_workspaces_query(self):
query = get_workspaces_query()
self.assertIn(query)
self.assertEqual('''
query {
boards {
workspace {
id
name
kind
description
}
}
}
'''.replace(" ", ""), query.replace(" ", ""))

def test_create_workspace_query(self):
query = create_workspace_query(self.workspace_name, self.workspace_kind)
Expand Down

0 comments on commit 715e67a

Please sign in to comment.