From 05ba1d6eb9ae24ed96dbf400d35b33c6148d5af1 Mon Sep 17 00:00:00 2001 From: Christina D'Astolfo Date: Mon, 7 Feb 2022 16:21:23 -0500 Subject: [PATCH] fix failiing workspaces test, attempt to add github test workflow --- .github/workflows/test.yml | 34 +++++++++++++++++++++++++ monday/query_joins.py | 6 +++++ monday/tests/test_workspace_resource.py | 13 +++++++++- 3 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..585e4c4 --- /dev/null +++ b/.github/workflows/test.yml @@ -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 \ No newline at end of file diff --git a/monday/query_joins.py b/monday/query_joins.py index 1ae8d97..4971614 100644 --- a/monday/query_joins.py +++ b/monday/query_joins.py @@ -469,6 +469,7 @@ def get_complexity_query(): return query + def get_workspaces_query(): query = ''' query { @@ -484,6 +485,7 @@ def get_workspaces_query(): ''' return query + def create_workspace_query(name, kind, description=""): query = ''' mutation { @@ -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 { @@ -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 { @@ -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 { @@ -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 { diff --git a/monday/tests/test_workspace_resource.py b/monday/tests/test_workspace_resource.py index 1e029ae..068802f 100644 --- a/monday/tests/test_workspace_resource.py +++ b/monday/tests/test_workspace_resource.py @@ -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)