Esempio n. 1
0
    def runit(self):
        print "======run it======="
        project_base = AppSetting.getSetting("projectbase")[0]
        workspace_name = AppSetting.getSetting("workspace")[0]
        root_location = self.workspace.rootlocation
        entrance = self.workspace.entrance
        log_path = os.path.join(project_base, workspace_name, root_location, 'log.txt')
        if os.path.exists(log_path):
            os.remove(log_path)
        workspace_web = os.path.join(project_base, workspace_name, root_location, 'web')
        file_place = os.path.join(project_base, workspace_name, root_location, 'web/features', entrance)
        file_path = file_place + '.feature'

        cmd_gen_bin = 'cd {0} && {1} {2} --with-subunit'.format(workspace_web, 'lettuce', file_path)

        subprocess.call([cmd_gen_bin], shell=True)
        cmd_gen_sub_unit2 ='subunit2junitxml < {0}/subunit.bin'.format(workspace_web)
        process = subprocess.Popen(cmd_gen_sub_unit2, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
        (stdoutput, erroutput) = process.communicate()
        log = TestLog()
        log.fill(self.execution, stdoutput, "lettuce stdout")
        log.save()
        os.remove('{0}/subunit.bin'.format(workspace_web))



        self.unlock_feature()
        print "==================="
Esempio n. 2
0
 def move_lib_folders(self):
     lib_path = []
     all = FeatureLocation.getLocation(self.type)
     for item in all:
         source_folder = AppSetting.getSetting('projectbase')[0] + item
         shutil.copytree(source_folder, self.getFolderPath() + '/' + str(self.type))
         lib_path.append(item)
     return lib_path
Esempio n. 3
0
 def getFolderPath(self):
     project_base = AppSetting.getSetting('projectbase')
     work_space = AppSetting.getSetting('workspace')
     folder_path = project_base[0] + work_space[0] + '/' + str(self.rootlocation)
     return folder_path
Esempio n. 4
0
 def test_aa_app_setting(self):
     print '.'*20+'test_aa_app_setting'+'.'*20
     results= AppSetting.getSetting('workspace')
     self.assertEqual(len(results),1)
     self.assertEqual(results[0],'workspaces')