'Test the run command for each container workflow'

def test_run_command_good(self):

    url = u'/v1/apps'
    response = self.client.post(url, HTTP_AUTHORIZATION=u'token    {}'.format(self.token))
    self.assertEqual(response.status_code, 201)
    app_id = response.data[u'id']
    app = App.objects.get(id=app_id)
    user = User.objects.get(username=u'autotest')
    build = Build.objects.create(owner=user, app=app, image=u'qwerty', procfile={u'web': u'node    server.js', u'worker': u'node    worker.js'}, dockerfile=u'foo', sha=u'somereallylongsha')
    release = Release.objects.create(version=2, owner=user, app=app, config=app.config_set.latest(), build=build)
    c = Container.objects.create(owner=user, app=app, release=release, type=u'web', num=1)
    (rc, output) = c.run(u'echo    hi')
    self.assertEqual(rc, 0)
    self.assertEqual(json.loads(output)[u'entrypoint'], u'/bin/bash')
    build.dockerfile = None
    build.sha = None
    (rc, output) = c.run(u'echo    hi')
    self.assertEqual(json.loads(output)[u'entrypoint'], u'/bin/bash')
    build.sha = u'somereallylongsha'
    (rc, output) = c.run(u'echo    hi')
    self.assertEqual(json.loads(output)[u'entrypoint'], u'/runner/init')
