docstr: Test resource allocation
docstr_tok: ["Test","resource","allocation"]
code: def test_resource(self):
      """Test resource allocation"""
      connector = SQLiteConnector(self.db_file)
      self.assertListEqual(
          connector.get_resource_type(), ["gpu", "cpu", "passive"]
      )
  
      rids = connector.get_available_resource(self.username, "gpu")
      self.assertEqual({1, 2}, set(rids))
  
      connector.take_available_resource(1)
      rids = connector.get_available_resource(self.username, "gpu")
      self.assertEqual({2}, set(rids))
  
      connector.free_used_resource(1)
      rids = connector.get_available_resource(self.username, "gpu")
      self.assertEqual({1, 2}, set(rids))
  
      connector.take_available_resource(2)
      connector.take_available_resource(1)
      rids = connector.get_available_resource(self.username, "gpu")
      self.assertEqual(set([]), set(rids))
  
      connector.free_used_resource(1)
      connector.free_used_resource(2)
      rids = connector.get_available_resource(self.username, "gpu")
      self.assertEqual({1, 2}, set(rids))
      connector.close()
  
file_path: auptimizer/tests/ET/Connector/test_SQLiteConnector.py
imports: import os
  import sqlite3
  import unittest
  from six.moves import configparser
  from aup.ET.Connector.SQLiteConnector import SQLiteConnector
  from aup.setupdb import sqlite
label_desc: Use image node_id 3 for calling the SQLiteConnectorTestCase obj's underlying member method code with example usage: obj.test_resource() without return types