<commit_before>import json
import os
import watch

from vent.api.actions import Action
from vent.helpers.paths import PathDirs


def test_settings():
    """ Tests settings """
    os.environ['REMOTE_REDIS_HOST'] = "localhost"
    os.environ['REMOTE_REDIS_PORT'] = "6379"
    import settings


def test_file_queue():
    """ Tests simulation of new file """
    path_dirs = PathDirs()
    images = watch.file_queue('/tmp/foo')
    assert not images[0]
    images = watch.file_queue('host_/tmp/foo',
                              template_path=path_dirs.base_dir,
                              r_host="localhost")
    assert isinstance(images, tuple)
    assert images[0]
    assert isinstance(images[1], list)
    instance = Action()
    status = instance.add('https://github.com/cyberreboot/vent-plugins',
                          branch='master',
                          tools=[('gpu_example','')],
                          build=True)
    assert isinstance(status, tuple)
    assert status[0]
    images = watch.file_queue('host_/tmp/foo.matrix',
                              template_path=path_dirs.base_dir,
                              r_host="localhost")
    assert isinstance(images, tuple)
    assert images[0]
    assert isinstance(images[1], list)


def test_gpu_queue():
    """ Tests simulation of gpu job """<commit_msg>fix spacing<commit_after>import json
import os
import watch

from vent.api.actions import Action
from vent.helpers.paths import PathDirs


def test_settings():
    """ Tests settings """
    os.environ['REMOTE_REDIS_HOST'] = "localhost"
    os.environ['REMOTE_REDIS_PORT'] = "6379"
    import settings


def test_file_queue():
    """ Tests simulation of new file """
    path_dirs = PathDirs()
    images = watch.file_queue('/tmp/foo')
    assert not images[0]
    images = watch.file_queue('host_/tmp/foo',
                              template_path=path_dirs.base_dir,
                              r_host="localhost")
    assert isinstance(images, tuple)
    assert images[0]
    assert isinstance(images[1], list)
    instance = Action()
    status = instance.add('https://github.com/cyberreboot/vent-plugins',
                          branch='master',
                          tools=[('gpu_example', '')],
                          build=True)
    assert isinstance(status, tuple)
    assert status[0]
    images = watch.file_queue('host_/tmp/foo.matrix',
                              template_path=path_dirs.base_dir,
                              r_host="localhost")
    assert isinstance(images, tuple)
    assert images[0]
    assert isinstance(images[1], list)


def test_gpu_queue():
    """ Tests simulation of gpu job """
{'fraction_non_alphanumeric': 0.11347517730496454, 'fraction_numerical': 0.007465472191116088, 'mean_word_length': 2.272283272283272, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7129804', 'n_tokens_mistral': 765, 'n_tokens_neox': 751, 'n_words': 163}