docstr: Tests SQLiteConnector.get_available_resource
docstr_tok: ["Tests","SQLiteConnector.get_available_resource"]
code: def test_get_available_resource(self):
      """Tests SQLiteConnector.get_available_resource"""
      rid = 1
      connector = SQLiteConnector(self.db_file)
      rids = connector.get_available_resource("test", "cpu")
      self.assertGreaterEqual(len(rids), 1)
      rids1 = connector.get_available_resource("test", "cpu", rids[:-1])
      self.assertEqual(len(rids1), 1)
      rids2 = connector.get_available_resource("test", "cpu", rids)
      self.assertEqual(len(rids), 1)
  
      def test_save_intermediate_result(self):
          """Test saving of intermediate results"""
  
      connector = SQLiteConnector(self.db_file)
      eid = connector.start_experiment(self.name, "test", "{}")
      rid = 1
      jid1 = connector.job_started(eid, rid, "job1")
  
      self.assertListEqual(connector.get_running_job(eid), [jid1])
  
      connector.save_intermediate_result(jid1, -50.0)
      connector.save_intermediate_result(jid1, -75.0)
      connector.save_intermediate_result(jid1, -100.0)
      connector.job_finished(eid, jid1, -100.0)
  
      connector.cursor.execute(
          "SELECT num, score FROM intermediate_result WHERE jid=? ORDER BY num ASC;",
          (jid1,),
      )
      irs = connector.cursor.fetchall()
      self.assertEqual(len(irs), 3)
      self.assertEqual(irs[0][0], 0)
      self.assertEqual(irs[1][0], 1)
      self.assertEqual(irs[2][0], 2)
      self.assertEqual(irs[0][1], -50.0)
      self.assertEqual(irs[1][1], -75.0)
      self.assertEqual(irs[2][1], -100.0)
      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 8 for calling the SQLiteConnectorTestCase obj's underlying member method code with example usage: obj.test_get_available_resource() without return types