def test_import_remove_system(self):
        # export, add one system, assert the sytem was added, remove it, assert
        # it was removed
        sblob = self.get_service(self.s1.iql_stmt())

        # create
        s = create_fake_host(hostname='hihihi.mozilla.com')

        # add
        sblob['services'][0]['systems'].append(s.hostname)

        # new host shouldn't exist in the service
        self.assertFalse(self.s1.systems.filter(hostname=s.hostname).exists())

        # import
        _, resp = self.import_services(sblob)
        self.assertEqual(resp.status_code, 200, resp.content)

        # new host should now exist in the service
        self.assertTrue(self.s1.systems.filter(hostname=s.hostname).exists())

        # refresh the blob for good measure
        sblob = self.get_service(self.s1.iql_stmt())

        # make sure the system's hostname is in the blob (this may be
        # redundant)
        self.assertTrue(sblob['services'][0]['systems'] in s.hostname)
        # remove the host form the export blob
        sblob['services'][0]['systems'].remove(s.hostname)

        # import the blob
        _, resp = self.import_services(sblob)
        self.assertEqual(resp.status_code, 200, resp.content)

        # make sure it was removed
        self.assertFalse(self.s1.systems.filter(hostname=s.hostname).exists())
dataset/ETHPy150Open mozilla/inventory/core/service/tests/test_api.py/ServiceAPITests.test_import_remove_system/swapped operands of `in`