import molequeue

client = molequeue.Client()
client.connect_to_server('MoleQueue')

job_request = molequeue.JobRequest()
job_request.queue = 'salix'
job_request.program = 'sleep (testing)'

client.submit_job_request(job_request)
import unittest

import molequeue

class TestClient(unittest.TestCase):

  def test_submit_job_request(self):
    client = molequeue.Client()
    client.connect_to_server('MoleQueue')

    job_request = molequeue.JobRequest()
    job_request.queue = 'salix'
    job_request.program = 'sleep (testing)'

    client.submit_job_request(job_request)

if __name__ == '__main__':
    unittest.main()

Convert test case to Python unittest.TestCase
Convert test case to Python unittest.TestCase

Use Python's testing framework

Change-Id: I924f329c43294bb1fbb395a7bb19bcaf06ea9385

+ import unittest
+ 
  import molequeue
  
+ class TestClient(unittest.TestCase):
- client = molequeue.Client()
- client.connect_to_server('MoleQueue')
  
- job_request = molequeue.JobRequest()
- job_request.queue = 'salix'
- job_request.program = 'sleep (testing)'
+   def test_submit_job_request(self):
+     client = molequeue.Client()
+     client.connect_to_server('MoleQueue')
  
+     job_request = molequeue.JobRequest()
+     job_request.queue = 'salix'
+     job_request.program = 'sleep (testing)'
+ 
- client.submit_job_request(job_request)
+     client.submit_job_request(job_request)
+ 
+ if __name__ == '__main__':
+     unittest.main()
+ 
Convert test case to Python unittest.TestCase
## Code Before:
import molequeue

client = molequeue.Client()
client.connect_to_server('MoleQueue')

job_request = molequeue.JobRequest()
job_request.queue = 'salix'
job_request.program = 'sleep (testing)'

client.submit_job_request(job_request)
## Instruction:
Convert test case to Python unittest.TestCase
## Code After:
import unittest

import molequeue

class TestClient(unittest.TestCase):

  def test_submit_job_request(self):
    client = molequeue.Client()
    client.connect_to_server('MoleQueue')

    job_request = molequeue.JobRequest()
    job_request.queue = 'salix'
    job_request.program = 'sleep (testing)'

    client.submit_job_request(job_request)

if __name__ == '__main__':
    unittest.main()
