Exemplo n.º 1
0
 def test_process(self):
     out = process("ls -lart")
     self.assertEqual(out.__class__, subprocess.Popen)
     out = line_process("echo foo")
     self.assertEqual("foo", out)
Exemplo n.º 2
0
 def test_git_get(self):
     status = line_process("git config --get core.ignorecase")
     out = git_get('core.ignorecase')
     self.assertEqual(out, status)
Exemplo n.º 3
0
    namer_gen = namer()
    # this will bury each file in a dir path up to dir_levels(3) deep
    shutil.copyfile(root_dir + os.path.sep + "REST_Notify.py", user_base_dir + os.path.sep + "REST_Notify.py")
    shutil.copyfile(root_dir + os.path.sep + "gitonate_settings.py", user_base_dir + os.path.sep + "gitonate_settings.py")
    for f in file_names[:files]:
        dir_levels = random.randint(0,3)
        for i in range(dir_levels):
            d = next(namer_gen)
            os.mkdir(d)
            os.chdir(d)
        paths.append(os.getcwd() + os.path.sep + f)
        f = open(f, "w")
        f.write("first line of file")
        f.close()
        os.chdir(user_base_dir)
    out = line_process("git init")
    out = line_process("git add *")
    out = line_process("git commit -m 'initial_commit'")
    out = line_process("git status")

    os.chdir(base_dir)
    for i in range(0, users):
    # make a dir for each user
        os.mkdir(user_names[i])
        os.chdir(user_names[i])
        out = line_process("git clone {0}".format(user_base_dir))
        print out
        os.chdir(base_dir)

    # now lets make random changes to files in each users directory
    # and commit them.