From 7d1c7b701d0fefc8639b24ab515f2d9b18906dbc Mon Sep 17 00:00:00 2001 From: Vermaas <vermaas@astron.nl> Date: Tue, 16 Jan 2024 15:38:45 +0100 Subject: [PATCH] handling review comments --- atdb/taskdatabase/tests/test_path_to_lta.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/atdb/taskdatabase/tests/test_path_to_lta.py b/atdb/taskdatabase/tests/test_path_to_lta.py index fa4b0a93..5f650159 100644 --- a/atdb/taskdatabase/tests/test_path_to_lta.py +++ b/atdb/taskdatabase/tests/test_path_to_lta.py @@ -1,5 +1,5 @@ from django.test import TestCase -from taskdatabase.models import Task, Workflow +from taskdatabase.models import Task class TaskModelTestCase(TestCase): def setUp(self): @@ -10,22 +10,26 @@ class TaskModelTestCase(TestCase): self.task2 = Task.objects.create(sas_id=12345,archive={'path_to_lta': None}) # this task has a valid path_to_lta set - self.task3 = Task.objects.create(sas_id=12345,archive={'path_to_lta': '/sample/path'}) + self.task3 = Task.objects.create(sas_id=12345,archive={'path_to_lta': '/sample/path', 'sas_id_archived': 54321}) # this sasid has no path_to_lta set at all self.task4 = Task.objects.create(sas_id=66666,archive={}) self.task5 = Task.objects.create(sas_id=66666,archive={}) def test_path_to_lta_with_path(self): - # if only one of the tasks has a path_to_lta, then the other tasks should also return that path for task in Task.objects.filter(sas_id=12345): result = task.sasid_path_to_lta self.assertEqual(result, '/sample/path') def test_path_to_lta_without_path(self): - # if one of the tasks has 'path_to_lta' set, then return None for task in Task.objects.filter(sas_id=66666): result = task.sasid_path_to_lta - self.assertEqual(result, None) \ No newline at end of file + self.assertEqual(result, None) + + def test_sas_id_has_archived(self): + # if only one of the tasks has a sas_id_has_archived, then the other tasks should also return that path + for task in Task.objects.filter(sas_id=12345): + result = task.sas_id_has_archived + self.assertEqual(result, 54321) \ No newline at end of file -- GitLab