def test_init_05(self):
     try:
         app1 = Apptt("name1", "shortname1", "desc1")
         app2 = Apptt("n1", "shortname1", "d1")
     except Meb_apps_exception as e:
         self.assertTrue(app1.app_id == app2.app_id)
     finally:
         self.assertTrue(pbclient.delete_app(app1.app_id))
         self.assertTrue(pbclient.delete_app(app2.app_id))
 def test_init_04(self):
     try:
         app = Apptt("name1", "shortname1", "desc1")
     except Meb_apps_exception as e:
         assert False
     finally:
         self.assertTrue(pbclient.delete_app(app.app_id))
 def tearDown(self):
     pbclient.delete_task(self.pb_task1.task.id)
     pbclient.delete_task(self.pb_task2.task.id)
     pbclient.delete_app(self.app.app_id)
 def tearDown(self):
     if not self.app_tt_meta == None:
         pbclient.delete_app(self.app_tt_meta.app_id)
 def tearDown(self):
     if not self.app_tt_select == None:
         pbclient.delete_app(self.app_tt_select.app_id)
 def tearDown(self):
     pbclient.delete_app(self.app_tt.app_id)
 def tearDown(self):
     if not self.app_tt_transcribe == None:
         pbclient.delete_app(self.app_tt_transcribe.app_id)
    if not options.template:
        print("Using default template: template.html")
        options.template = "template.html"

    if not options.tutorial:
        print("Using default tutorial template: tutorial.html")
        options.tutorial= "tutorial.html"

    if (options.verbose):
       print('Running against PyBosssa instance at: %s' % options.api_url)
       print('Using API-KEY: %s' % options.api_key)

    if (options.create):
        app = pbclient.find_app(short_name='deforestedareas')
        if len(app)!=0 :
            pbclient.delete_app(app[0].id)
        pbclient.create_app('Deforestation', 'deforestedareas',
                            'Help us to find deforested areas in the forest')
        app = pbclient.find_app(short_name='deforestedareas')[0]
        print app.id
        app.long_description = open('long_description.html').read()
        app.info['task_presenter'] = open(options.template).read()
        app.info['thumbnail'] = "http://img204.imageshack.us/img204/6598/deforestation.png"
        app.info['tutorial'] = open(options.tutorial).read()
        pbclient.update_app(app)

        # Now add some tasks
        i = 0
        for t in completed_tasks:
            #maxVert, maxHor, minVert, minHor = map(float, tile.split(" "))
            #data = [minHor, minVert, maxHor, maxVert]