Ejemplo n.º 1
0
def test_generate_tags_dir_out():

    args = base_setup()

    from tempfile import TemporaryDirectory

    with TemporaryDirectory() as tmpdir:

        args.tags = "1girl, white_swimsuit"
        args.output = tmpdir

        generate(args)

        out_fn = os.path.join(tmpdir, '1girl_white_swimsuit.webp')

        assert os.path.isfile(out_fn)
Ejemplo n.º 2
0
def test_generate_tags_set_file_out():

    args = base_setup()

    from tempfile import TemporaryDirectory

    with TemporaryDirectory() as tmpdir:

        out_fn = os.path.join(tmpdir, "my_cool_gen.webp")

        args.tags = "1girl, white_swimsuit"
        args.output = out_fn

        generate(args)

        assert os.path.isfile(out_fn)
Ejemplo n.º 3
0
def test_generate_using_source():

    args = base_setup()

    from tempfile import TemporaryDirectory

    with TemporaryDirectory() as tmpdir:

        tag_file = os.path.join(tmpdir, "test_tags.txt")

        with open(tag_file, 'w') as f:
            f.write("1girl, white_swimsuit")

        args.source = tmpdir
        args.output = tmpdir

        generate(args)

        out_fn = os.path.join(tmpdir, 'test_tags.webp')

        assert os.path.isfile(out_fn)