old_contents: #    Copyright 2016 SAS Project Authors. All Rights Reserved.
  #
  #    Licensed under the Apache License, Version 2.0 (the "License");
  #    you may not use this file except in compliance with the License.
  #    You may obtain a copy of the License at
  #
  #        http://www.apache.org/licenses/LICENSE-2.0
  #
  #    Unless required by applicable law or agreed to in writing, software
  #    distributed under the License is distributed on an "AS IS" BASIS,
  #    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  #    See the License for the specific language governing permissions and
  #    limitations under the License.
  import json
  import os
  import unittest
  
  import sas
  
  
  class DeregistrationTestcase(unittest.TestCase):
  
    def setUp(self):
      self._sas, self._sas_admin = sas.GetTestingSas()
      self._sas_admin.Reset()
  
    def tearDown(self):
      pass
  
    def test_10_15_4_1_1(self):
      # Register the device
      device_a = json.load(
          open(os.path.join('testcases', 'testdata', 'device_a.json')))
      request = {'registrationRequest': [device_a]}
      response = self._sas.Registration(request)['registrationResponse'][0]
      # Check registration response
      self.assertEqual(response['response']['responseCode'], 0)
      cbsd_id = response['cbsdId']
      del request, response
  
      # Deregister the device
      request = {'deregistrationRequest': [{'cbsdId': cbsd_id}]}
      response = self._sas.Deregistration(request)['deregistrationResponse'][0]
      # Check the deregistration response
      self.assertEqual(response['cbsdId'], cbsd_id)
      self.assertEqual(response['response']['responseCode'], 0)
  
new_contents: #    Copyright 2016 SAS Project Authors. All Rights Reserved.
  #
  #    Licensed under the Apache License, Version 2.0 (the "License");
  #    you may not use this file except in compliance with the License.
  #    You may obtain a copy of the License at
  #
  #        http://www.apache.org/licenses/LICENSE-2.0
  #
  #    Unless required by applicable law or agreed to in writing, software
  #    distributed under the License is distributed on an "AS IS" BASIS,
  #    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  #    See the License for the specific language governing permissions and
  #    limitations under the License.
  import json
  import os
  import unittest
  
  import sas
  
  
  class DeregistrationTestcase(unittest.TestCase):
  
    def setUp(self):
      self._sas, self._sas_admin = sas.GetTestingSas()
      self._sas_admin.Reset()
  
    def tearDown(self):
      pass
  
    def test_10_15_4_1_1(self):
      """Successful CBSD deregistration request.
  
      CBSD sends deregistration request to SAS with its correct and valid CBSD
      ID, the response should be SUCCESS.
      """
  
      # Register the device
      device_a = json.load(
          open(os.path.join('testcases', 'testdata', 'device_a.json')))
      request = {'registrationRequest': [device_a]}
      response = self._sas.Registration(request)['registrationResponse'][0]
      # Check registration response
      self.assertEqual(response['response']['responseCode'], 0)
      cbsd_id = response['cbsdId']
      del request, response
  
      # Deregister the device
      request = {'deregistrationRequest': [{'cbsdId': cbsd_id}]}
      response = self._sas.Deregistration(request)['deregistrationResponse'][0]
      # Check the deregistration response
      self.assertEqual(response['cbsdId'], cbsd_id)
      self.assertEqual(response['response']['responseCode'], 0)
  
subject: Update deregistration_testcase.py