Exemplo n.º 1
0
def test_run():
    """Test a full run."""
    src_path = "./test/testsource"
    dst_path = "./test/testdestination"
    
    argv = ("main.py", src_path, dst_path)
    
    main = Main(argv)
    main.run()
    
    destfile1 = "./test/testdestination/rosa (814837)/"
    destfile1 += "(814837) ろさ - 空と私.jpg"
    print(destfile1)
    assert os.path.exists(destfile1)
    destfile2 = "./test/testdestination/cherrypin (206921)/"
    destfile2 += "(206921) cherrypin - イラスト集め"
    assert os.path.exists(destfile2)
    
    # Copy files back
    shutil.copy2(destfile1, src_path)
    os.remove(destfile1)
    
    shutil.copytree(destfile2, 
                    "./test/testsource/(206921) cherrypin - イラスト集め")
    shutil.rmtree(destfile2)
    
    srcfile1 = "./test/testsource/(814837) ろさ - 空と私.jpg"
    assert os.path.exists(srcfile1)
    srcfile2 = "./test/testsource/(206921) cherrypin - イラスト集め"
    assert os.path.exists(srcfile2)
Exemplo n.º 2
0
def test_run():
    """Test a full run."""
    src_path = "./test/testsource"
    dst_path = "./test/testdestination"

    argv = ("main.py", src_path, dst_path)

    main = Main(argv)
    main.run()

    destfile1 = "./test/testdestination/rosa (814837)/"
    destfile1 += "(814837) ろさ - 空と私.jpg"
    print(destfile1)
    assert os.path.exists(destfile1)
    destfile2 = "./test/testdestination/cherrypin (206921)/"
    destfile2 += "(206921) cherrypin - イラスト集め"
    assert os.path.exists(destfile2)

    # Copy files back
    shutil.copy2(destfile1, src_path)
    os.remove(destfile1)

    shutil.copytree(destfile2, "./test/testsource/(206921) cherrypin - イラスト集め")
    shutil.rmtree(destfile2)

    srcfile1 = "./test/testsource/(814837) ろさ - 空と私.jpg"
    assert os.path.exists(srcfile1)
    srcfile2 = "./test/testsource/(206921) cherrypin - イラスト集め"
    assert os.path.exists(srcfile2)
Exemplo n.º 3
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from pixivsort.main import Main
from sys import argv

main = Main(argv)
main.run()