コード例 #1
0
ファイル: test_filesystem.py プロジェクト: Dasona/DIGITS
# Copyright (c) 2015-2017, NVIDIA CORPORATION.  All rights reserved.
from __future__ import absolute_import

import os
import random
import shutil
import tempfile

from nose.tools import assert_raises

from . import filesystem as fs
from digits import test_utils


test_utils.skipIfNotFramework('none')


class TestTreeSize():

    def test_bad_path(self):
        for path in [
                'some string',
                '/tmp/not-a-file',
                'http://not-a-url',
        ]:
            yield self.check_bad_path, path

    def check_bad_path(self, path):
        assert_raises(ValueError, fs.get_tree_size, path)

    def test_empty_folder(self):
コード例 #2
0
ファイル: test_image.py プロジェクト: ojmakhura/DIGITS
import tempfile

# Find the best implementation available
from io import StringIO

import mock
from nose.tools import assert_raises
import numpy as np
import PIL.Image

from . import errors
from . import image as image_utils
import digits
from digits import test_utils

test_utils.skipIfNotFramework('none')


class TestLoadImage():
    def test_bad_path(self):
        for path in [
                'some string',
                '/tmp/not-a-file',
                'http://not-a-url',
        ]:
            yield self.check_none, path

    def check_none(self, path):
        assert_raises(
            errors.LoadImageError,
            image_utils.load_image,
コード例 #3
0
def test_caffe_imports():
    test_utils.skipIfNotFramework('caffe')

    import numpy
    import google.protobuf
コード例 #4
0
ファイル: test_caffe_train.py プロジェクト: ojmakhura/DIGITS
def test_caffe_imports():
    test_utils.skipIfNotFramework('caffe')

    import numpy  # noqa
    import google.protobuf  # noqa
コード例 #5
0
# Copyright (c) 2014-2017, NVIDIA CORPORATION.  All rights reserved.
from __future__ import absolute_import

from digits import test_utils
test_utils.skipIfNotFramework('caffe')

from .caffe_train import CaffeTrainTask, CaffeTrainSanityCheckError

from google.protobuf import text_format

# Must import after importing digit.config
import caffe_pb2


def check_positive(desc, stage):
    network = caffe_pb2.NetParameter()
    text_format.Merge(desc, network)
    CaffeTrainTask.net_sanity_check(network, stage)


def check_negative(desc, stage):
    network = caffe_pb2.NetParameter()
    text_format.Merge(desc, network)
    try:
        CaffeTrainTask.net_sanity_check(network, stage)
    except CaffeTrainSanityCheckError:
        pass


class TestCaffeNetSanityCheck(test_utils.CaffeMixin):