Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
9711ceb
feat: TT-356 Read activities with an azure endpoint
Oct 11, 2021
193261f
refactor: TT-356 Solving code smells from Sonarcloud
Oct 11, 2021
7a8df35
refactor: TT-356 Solving merge conflicts
Oct 13, 2021
11831bd
refactor: TT-356 change directory from files in source to azure_time_…
Oct 13, 2021
6967d42
test: TT-356 Adding azure endpoint api test
Oct 13, 2021
d9ab6a4
feat: TT-358 Use serverless to create Azure endpoint
Oct 14, 2021
c878eb3
refactor: TT-358 Changing time tracker backend app skeleton
Oct 15, 2021
1c28197
refactor: TT-358 Change name to the domain partitioning
Oct 18, 2021
2eb86cd
refactor: TT-358 Change route of activities data json file for azure …
Oct 18, 2021
8a073c3
refactor: TT-358 Change folder structure according to new app skeleton
Oct 19, 2021
f176589
feat: TT-358 Add Makefile to install time tracker backend
Oct 20, 2021
7325a84
refactor: TT-367 merge branch TT-358
JosueOb Oct 21, 2021
936c71e
refactor: TT-358 Change api test to use create temp activities fixture
Oct 22, 2021
b823e87
refactor: TT-367 solving merge conflicts
JosueOb Oct 25, 2021
f13bc69
feat: TT-367 creation of the functionality to change the status of an…
JosueOb Oct 25, 2021
687387f
test: TT-367 unit test for activity service
JosueOb Oct 26, 2021
54ba9cd
test: TT-367 unit test for delete activity use case
JosueOb Oct 26, 2021
2954640
test: TT-367 integration test for activities json dao
JosueOb Oct 26, 2021
d3629b9
test: TT-367 api test for endpoint to delete an activity
JosueOb Oct 26, 2021
e2284c9
refactor: TT-367 solving merge conflicts
JosueOb Oct 26, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
test: TT-356 Adding azure endpoint api test
  • Loading branch information
Andrés Soto committed Oct 13, 2021
commit 6967d42482d8def732d878131918b3b92d76557b
44 changes: 44 additions & 0 deletions V2/azure_time_tracker/time_tracker/tests/api/api_fixtures.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import json
import pytest
import shutil


@pytest.fixture
def activities_json(tmpdir_factory):
temporary_directory = tmpdir_factory.mktemp("tmp")
json_file = temporary_directory.join("activities.json")
activities = [
{
'id': 'c61a4a49-3364-49a3-a7f7-0c5f2d15072b',
'name': 'Development',
'description': 'Development',
'deleted': 'b4327ba6-9f96-49ee-a9ac-3c1edf525172',
'status': None,
'tenant_id': 'cc925a5d-9644-4a4f-8d99-0bee49aadd05',
},
{
'id': '94ec92e2-a500-4700-a9f6-e41eb7b5507c',
'name': 'Management',
'description': None,
'deleted': '7cf6efe5-a221-4fe4-b94f-8945127a489a',
'status': None,
'tenant_id': 'cc925a5d-9644-4a4f-8d99-0bee49aadd05',
},
{
'id': 'd45c770a-b1a0-4bd8-a713-22c01a23e41b',
'name': 'Operations',
'description': 'Operation activities performed.',
'deleted': '7cf6efe5-a221-4fe4-b94f-8945127a489a',
'status': 'active',
'tenant_id': 'cc925a5d-9644-4a4f-8d99-0bee49aadd05',
},
]

with open(json_file, 'w') as outfile:
json.dump(activities, outfile)

with open(json_file) as outfile:
activities_json = json.load(outfile)

yield activities_json
shutil.rmtree(temporary_directory)
Original file line number Diff line number Diff line change
@@ -1,50 +1,7 @@
from activities import main
import azure.functions as func
import json
import pytest
import typing
import shutil


@pytest.fixture
def activities_json(tmpdir_factory):
temporary_directory = tmpdir_factory.mktemp("tmp")
json_file = temporary_directory.join("activities.json")
activities = [
{
'id': 'c61a4a49-3364-49a3-a7f7-0c5f2d15072b',
'name': 'Development',
'description': 'Development',
'deleted': 'b4327ba6-9f96-49ee-a9ac-3c1edf525172',
'status': None,
'tenant_id': 'cc925a5d-9644-4a4f-8d99-0bee49aadd05',
},
{
'id': '94ec92e2-a500-4700-a9f6-e41eb7b5507c',
'name': 'Management',
'description': None,
'deleted': '7cf6efe5-a221-4fe4-b94f-8945127a489a',
'status': None,
'tenant_id': 'cc925a5d-9644-4a4f-8d99-0bee49aadd05',
},
{
'id': 'd45c770a-b1a0-4bd8-a713-22c01a23e41b',
'name': 'Operations',
'description': 'Operation activities performed.',
'deleted': '7cf6efe5-a221-4fe4-b94f-8945127a489a',
'status': 'active',
'tenant_id': 'cc925a5d-9644-4a4f-8d99-0bee49aadd05',
},
]

with open(json_file, 'w') as outfile:
json.dump(activities, outfile)

with open(json_file) as outfile:
activities_json = json.load(outfile)

yield activities_json
shutil.rmtree(temporary_directory)


def test__activity_azure_endpoint__returns_all_activities(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from flask.testing import FlaskClient
from http import HTTPStatus
from faker import Faker
import shutil


@pytest.fixture
Expand All @@ -15,47 +14,6 @@ def client():
yield client


@pytest.fixture
def activities_json(tmpdir_factory):
temporary_directory = tmpdir_factory.mktemp("tmp")
json_file = temporary_directory.join("activities.json")
activities = [
{
'id': 'c61a4a49-3364-49a3-a7f7-0c5f2d15072b',
'name': 'Development',
'description': 'Development',
'deleted': 'b4327ba6-9f96-49ee-a9ac-3c1edf525172',
'status': None,
'tenant_id': 'cc925a5d-9644-4a4f-8d99-0bee49aadd05',
},
{
'id': '94ec92e2-a500-4700-a9f6-e41eb7b5507c',
'name': 'Management',
'description': None,
'deleted': '7cf6efe5-a221-4fe4-b94f-8945127a489a',
'status': None,
'tenant_id': 'cc925a5d-9644-4a4f-8d99-0bee49aadd05',
},
{
'id': 'd45c770a-b1a0-4bd8-a713-22c01a23e41b',
'name': 'Operations',
'description': 'Operation activities performed.',
'deleted': '7cf6efe5-a221-4fe4-b94f-8945127a489a',
'status': 'active',
'tenant_id': 'cc925a5d-9644-4a4f-8d99-0bee49aadd05',
},
]

with open(json_file, 'w') as outfile:
json.dump(activities, outfile)

with open(json_file) as outfile:
activities_json = json.load(outfile)

yield activities_json
shutil.rmtree(temporary_directory)


def test_test__activity_endpoint__returns_all_activities(
client: FlaskClient, activities_json: typing.List[dict]
):
Expand Down
1 change: 1 addition & 0 deletions V2/azure_time_tracker/time_tracker/tests/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from time_tracker.tests.api.api_fixtures import activities_json