Пример #1
0
    def __init__(self, dbver=None, filename=None):
        config.set_defaults(default_config)
        if not OSX:
            self.xselpath = which("xsel")
            config.set_value("Global", "xsel", self.xselpath)
        else:
            self.xselpath = "xsel"

        self.dbver = dbver
        self.filename = filename
Пример #2
0
 def test_c_change_pass(self):
     lfile = 'test-chg_passwd.log'
     logfile = open(lfile, 'wb')
     cmd = which('pwman3')
     db = 'sqlite://' + os.path.join(os.path.dirname(__file__), 'foo.baz.db')
     child = pexpect.spawn(cmd + ' -d ' + db, logfile=logfile)
     if sys.version_info[0] > 2:
         child.expect('[\s|\S]+(password:)$', timeout=10)
     child.sendline('foobar')
     child.sendline('foobar')
     self.clean_files()
Пример #3
0
    def __init__(self, dbver=None, filename=None, dburi=None):

        f = open(os.path.join(os.path.dirname(__file__), 'test.conf'), 'w')
        f.write(dc)
        f.close()
        self.configp = config.Config(os.path.join(os.path.dirname(__file__),
                                                  "test.conf"),
                                     config.default_config)

        self.configp.set_value('Database', 'dburi',
                               'sqlite://' + os.path.join(
                                   os.path.abspath(os.path.dirname(__file__)),
                                   "test.pwman.db")
                               )

        if not OSX:
            self.xselpath = which("xsel")
            self.configp.set_value("Global", "xsel", self.xselpath)
        else:
            self.xselpath = "xsel"

        self.dbver = dbver
        self.dburi = self.configp.get_value('Database', 'dburi')