예제 #1
0
파일: utils.py 프로젝트: welldoer/Kiwi
    def _fixture_setup(self):
        # restore the serialized data from initial migrations
        # this includes default groups and permissions
        super(XmlrpcAPIBaseTest, self)._fixture_setup()
        self.api_user = UserFactory()
        self.api_user.set_password('api-testing')
        initiate_user_with_default_setups(self.api_user)

        # reset connection to server b/c the address changes for
        # every test and the client caches this as a class attribute
        tcms_api.TCMS._connection = None

        # WARNING: for now we override the config file
        # until we can pass the testing configuration
        # TODO: change config values instead of overwriting files on disk
        conf_path = os.path.expanduser('~/.tcms.conf')
        conf_fh = open(conf_path, 'w')
        conf_fh.write("""[tcms]
url = %s/xml-rpc/
username = %s
password = %s
""" % (self.live_server_url, self.api_user.username, 'api-testing'))
        conf_fh.close()

        # this is the XML-RPC ServerProxy with cookies support
        self.rpc_client = tcms_api.TCMS()
예제 #2
0
 def __init__(self, url, username, password, plan_id=0):
     self.rpc_client = tcms_api.TCMS(url, username, password).exec
     self.plan_id = plan_id
     self.test_run_id = 0
     self.test_case_statuses = {}
     self.products = {}
     self.builds = {}
     self.categories = {}
     #RobotFramework ha PASS E FAIL come risultato dei test: Kiwi ha come identificativo PASSED e FAILED
     self.test_exec_statuses = {
         'IDLE': 1,
         'RUNNING': 2,
         'PAUSED': 3,
         'PASS': 4,
         'FAIL': 5,
         'BLOCKED': 6,
         'ERROR': 7,
         'WAIVED': 8
     }
     self.test_case_list = []
     self.NOW = datetime.datetime.now().isoformat().replace('T', ' ')[:19]
     self.set_categories()
     self.set_builds()
     self.set_products()
     self.set_test_case_statuses()
예제 #3
0
 def __init__(self,url,username,password,plan_id=0):
     self.__dict__ = self._shared_state
     self.rpc_client = tcms_api.TCMS(url,username,password).exec
     self.plan_id = plan_id
     self.product= ''      
     self.test_run_id =0
     self.test_case_statuses= {}
     self.products= {}
     self.builds= {}
     self.categories= {}
     self.priority = {}
     self.node= ''
     # RobotFramework have PASS & FAIL as result for the test: Kiwi has PASSED e FAILED
     self.test_exec_statuses = {'IDLE':1,'RUNNING': 2,'PAUSED':3, 'PASS': 4, 'FAIL': 5 ,'BLOCKED': 6,'ERROR': 7, 'WAIVED': 8}
     self.NOW = datetime.datetime.now().isoformat().replace('T',' ')[:19]
     self.set_test_case_statuses()
     self.set_priority()
     self.set_products()