Esempio n. 1
0
 def test_validate_status_ds_unknown(self):
     """Test a status ds with an unknown element."""
     sop = StorageServiceClass(None)
     rsp = C_STORE()
     status = Dataset()
     status.Status = 0x0000
     status.PatientName = 'Test comment'
     rsp = sop.validate_status(status, rsp)
Esempio n. 2
0
 def test_validate_status_ds_none(self):
     """Test correct status returned if ds has no Status element."""
     sop = StorageServiceClass(None)
     rsp = C_STORE()
     status = Dataset()
     status.ErrorComment = 'Test comment'
     rsp = sop.validate_status(status, rsp)
     assert rsp.Status == 0xC001
Esempio n. 3
0
 def test_validate_status_ds(self):
     """Test that validate_status works correctly with dataset"""
     sop = StorageServiceClass(None)
     rsp = C_STORE()
     status = Dataset()
     status.Status = 0x0001
     rsp = sop.validate_status(status, rsp)
     assert rsp.Status == 0x0001
Esempio n. 4
0
 def test_validate_status_ds_multi(self):
     """Test that validate_status works correctly with dataset multi"""
     sop = StorageServiceClass(None)
     rsp = C_STORE()
     status = Dataset()
     status.Status = 0x0002
     status.ErrorComment = 'test'
     rsp = sop.validate_status(status, rsp)
     assert rsp.Status == 0x0002
     assert rsp.ErrorComment == 'test'
Esempio n. 5
0
 def test_validate_status_unknown(self):
     """Test return unknown status"""
     sop = StorageServiceClass(None)
     rsp = C_STORE()
     rsp = sop.validate_status(0xD011, rsp)
     assert rsp.Status == 0xD011
Esempio n. 6
0
 def test_validate_status_invalid(self):
     """Test exception raised if invalid status value"""
     sop = StorageServiceClass(None)
     rsp = C_STORE()
     rsp = sop.validate_status('test', rsp)
     assert rsp.Status == 0xC002
Esempio n. 7
0
 def test_validate_status_int(self):
     """Test that validate_status works correctly with int"""
     sop = StorageServiceClass(None)
     rsp = C_STORE()
     rsp = sop.validate_status(0x0000, rsp)
     assert rsp.Status == 0x0000