import json
import os
import watch

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)
    assert isinstance(images, tuple)
    assert images[0]
    assert isinstance(images[1], list)


def test_gpu_queue():
    """ Tests simulation of gpu job """
    options = json.dumps({'configs': {'devices': ['foo0', 'bar', 'baz3']}, 'gpu_options': {'device': '0'}, 'labels': {}, 'image': 'alpine:latest'})
    status = watch.gpu_queue(options)
    assert isinstance(status, tuple)

@@ -738,17 +738,16 @@
  'baz3'%5D
-%7D
 , 'gpu_o
@@ -770,16 +770,17 @@
 e': '0'%7D
+%7D
 , 'label

fix gpu_options location