Пример #1
0
    def test_exp_scp_user(self):
        # defaults to configuration defaults
        Configuration().core_clear()
        rsp = RsParameters()
        self.assertEquals("username", rsp.exp_scp_user)

        # contamination test
        rsp.exp_scp_user = "******"
        rsp2 = RsParameters(**rsp.__dict__)
        self.assertEquals("jan", rsp2.exp_scp_user)

        rsp.exp_scp_user = "******"
        rsp3 = RsParameters(**rsp.__dict__)
        self.assertEquals("wim", rsp3.exp_scp_user)

        self.save_configuration_test(rsp)
Пример #2
0
 def read_parameters(self):
     paras = RsParameters(config_name="DEFAULT")
     # configuration:
     cfg_file = os.path.join(os.path.expanduser("~"), CFG_FILE)
     with open(cfg_file) as cfg:
         line = cfg.readline()
     spup = line.split(",")
     paras.exp_scp_server = spup[0]
     paras.exp_scp_port = int(spup[1])
     paras.exp_scp_user = spup[2]
     password = spup[3]
     paras.exp_scp_document_root = spup[4]
     paras.scp_document_path = spup[5].strip()
     return paras, password