17 lines
957 B
Python
17 lines
957 B
Python
|
|
import unittest
|
||
|
|
from cleanup_verification import plan_rows
|
||
|
|
|
||
|
|
class LocalFrameworkCleanupTest(unittest.TestCase):
|
||
|
|
def data(self):
|
||
|
|
return {'lab_fixture':[{'id':1,'fixture_code':'E2E-LOCAL-FRAME-own'},{'id':2,'fixture_code':'CUSTOMER'}],
|
||
|
|
'lab_fixture_framework':[{'id':'own','fixture_id':1,'status':'READY','active_fixture_id':None},
|
||
|
|
{'id':'real','fixture_id':2,'status':'READY','active_fixture_id':None}]}
|
||
|
|
def test_only_owned_fixture_versions_are_selected(self):
|
||
|
|
plan=plan_rows(self.data(),['E2E-LOCAL-FRAME-own'])
|
||
|
|
self.assertEqual(['own'],[row['id'] for row in plan['lab_fixture_framework']])
|
||
|
|
def test_active_recording_blocks_cleanup(self):
|
||
|
|
data=self.data();data['lab_fixture_framework'][0]['active_fixture_id']=1
|
||
|
|
with self.assertRaisesRegex(ValueError,'仍在录入'):plan_rows(data,['E2E-LOCAL-FRAME-own'])
|
||
|
|
|
||
|
|
if __name__=='__main__':unittest.main()
|