|
| 1 | +import json |
| 2 | +import pytest |
| 3 | +import shutil |
| 4 | + |
| 5 | + |
| 6 | +@pytest.fixture |
| 7 | +def create_temp_activities(tmpdir_factory): |
| 8 | + temporary_directory = tmpdir_factory.mktemp("tmp") |
| 9 | + json_file = temporary_directory.join("activities.json") |
| 10 | + activities = [ |
| 11 | + { |
| 12 | + 'id': 'c61a4a49-3364-49a3-a7f7-0c5f2d15072b', |
| 13 | + 'name': 'Development', |
| 14 | + 'description': 'Development', |
| 15 | + 'deleted': 'b4327ba6-9f96-49ee-a9ac-3c1edf525172', |
| 16 | + 'status': 'active', |
| 17 | + 'tenant_id': 'cc925a5d-9644-4a4f-8d99-0bee49aadd05', |
| 18 | + }, |
| 19 | + { |
| 20 | + 'id': '94ec92e2-a500-4700-a9f6-e41eb7b5507c', |
| 21 | + 'name': 'Management', |
| 22 | + 'description': 'Description of management', |
| 23 | + 'deleted': '7cf6efe5-a221-4fe4-b94f-8945127a489a', |
| 24 | + 'status': 'active', |
| 25 | + 'tenant_id': 'cc925a5d-9644-4a4f-8d99-0bee49aadd05', |
| 26 | + }, |
| 27 | + { |
| 28 | + 'id': 'd45c770a-b1a0-4bd8-a713-22c01a23e41b', |
| 29 | + 'name': 'Operations', |
| 30 | + 'description': 'Operation activities performed.', |
| 31 | + 'deleted': '7cf6efe5-a221-4fe4-b94f-8945127a489a', |
| 32 | + 'status': 'active', |
| 33 | + 'tenant_id': 'cc925a5d-9644-4a4f-8d99-0bee49aadd05', |
| 34 | + }, |
| 35 | + ] |
| 36 | + |
| 37 | + with open(json_file, 'w') as outfile: |
| 38 | + json.dump(activities, outfile) |
| 39 | + |
| 40 | + yield activities, json_file |
| 41 | + shutil.rmtree(temporary_directory) |
| 42 | + |
| 43 | + |
| 44 | +@pytest.fixture |
| 45 | +def create_temp_time_entries(tmpdir_factory): |
| 46 | + temporary_directory = tmpdir_factory.mktemp("tmp") |
| 47 | + json_file = temporary_directory.join("time_entries.json") |
| 48 | + activities = [ |
| 49 | + { |
| 50 | + "id": 1, |
| 51 | + "start_date": "12/07/2021", |
| 52 | + "owner_id": 2, |
| 53 | + "description": "No se que poner jajaj ", |
| 54 | + "activity_id": 2, |
| 55 | + "uri": "http://hola.que.hace.com", |
| 56 | + "technologies": ["git", "jira", "python"], |
| 57 | + "end_date": "12/07/2021", |
| 58 | + "deleted": "asdasdsaadssa", |
| 59 | + "timezone_offset": "asdasdsa", |
| 60 | + "project_id": 1 |
| 61 | + }, { |
| 62 | + "id": 2, |
| 63 | + "start_date": "12/07/2021", |
| 64 | + "owner_id": 2, |
| 65 | + "description": "No se que poner jajaj ", |
| 66 | + "activity_id": 2, |
| 67 | + "uri": "http://hola.que.hace.com", |
| 68 | + "technologies": ["git", "jira", "python"], |
| 69 | + "end_date": "12/07/2021", |
| 70 | + "deleted": "asdasdsaadssa", |
| 71 | + "timezone_offset": "asdasdsa", |
| 72 | + "project_id": 1 |
| 73 | + }, { |
| 74 | + "id": 3, |
| 75 | + "start_date": "12/07/2021", |
| 76 | + "owner_id": 2, |
| 77 | + "description": "No se que poner jajaj ", |
| 78 | + "activity_id": 2, |
| 79 | + "uri": "http://hola.que.hace.com", |
| 80 | + "technologies": ["git", "jira", "python"], |
| 81 | + "end_date": "12/07/2021", |
| 82 | + "deleted": "asdasdsaadssa", |
| 83 | + "timezone_offset": "asdasdsa", |
| 84 | + "project_id": 1 |
| 85 | + } |
| 86 | + ] |
| 87 | + |
| 88 | + with open(json_file, 'w') as outfile: |
| 89 | + json.dump(activities, outfile) |
| 90 | + |
| 91 | + yield activities, json_file |
| 92 | + shutil.rmtree(temporary_directory) |
0 commit comments