diff options
author | Parker Berberian <pberberian@iol.unh.edu> | 2019-11-12 12:54:20 -0500 |
---|---|---|
committer | Brandon Lo <lobrandon1217@gmail.com> | 2020-01-28 13:28:34 -0500 |
commit | 899e1a4baa95d0bc6f0eef34de66f0e257174878 (patch) | |
tree | 2fbc99070b2fe2d75135ca5f899ed14b12639856 /src/api/tests | |
parent | 30a535d7e9bdc0e3cf637207c0c100a16db81586 (diff) |
Begin Resource Refactor
Begins the Resource Refactor by creating new interfaces
to the resources through a Resource super class
and using that new interface in the api
Change-Id: I15a8179bfe915d2cde6d658d056e11cbd2c70e43
Signed-off-by: Parker Berberian <pberberian@iol.unh.edu>
Diffstat (limited to 'src/api/tests')
-rw-r--r-- | src/api/tests/test_models_unittest.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/api/tests/test_models_unittest.py b/src/api/tests/test_models_unittest.py index e6f97a6..2ecbe42 100644 --- a/src/api/tests/test_models_unittest.py +++ b/src/api/tests/test_models_unittest.py @@ -1,4 +1,3 @@ -############################################################################## # Copyright (c) 2019 Sawyer Bergeron, Parker Berberian, and others. # # All rights reserved. This program and the accompanying materials @@ -21,6 +20,7 @@ from api.models import ( from resource_inventory.models import ( OPNFVRole, HostProfile, + ConfigState, ) from django.test import TestCase, Client @@ -201,7 +201,7 @@ class ValidBookingCreatesValidJob(TestCase): self.assertEqual(relation.status, JobStatus.NEW) config = relation.config host = relation.host - self.assertEqual(config.hostname, host.template.resource.name) + self.assertEqual(config.get_delta()["hostname"], host.template.resource.name) def test_complete_job_makes_software_configs(self): JobFactory.makeCompleteJob(self.booking) @@ -261,9 +261,10 @@ class ValidBookingCreatesValidJob(TestCase): host_set.remove(relation.host.id) except KeyError: self.fail("Hardware Relation/Config not created for host " + str(relation.host)) - - self.assertEqual(relation.config.power, "on") - self.assertTrue(relation.config.ipmi_create) + # TODO: ConfigState needs to be fixed in factory methods + relation.config.state = ConfigState.NEW + self.assertEqual(relation.config.get_delta()["power"], "on") + self.assertTrue(relation.config.get_delta()["ipmi_create"]) # TODO: the rest of hwconf attrs self.assertEqual(len(host_set), 0) |