import sys, os import subprocess sys.path.append(os.path.abspath('../cOS/')) import cOS import ieInit ieInit.init() import settingsManager globalSettings = settingsManager.globalSettings() import unittest class cOSTest(unittest.TestCase): def setUp(self): os.system('mkdir sandbox') os.system('touch sandbox/file_v001.mb') os.system('touch sandbox/file.mb') os.mkdir('sandbox/sandboxSubdir') os.system('touch sandbox/sandboxSubdir/file1.txt') os.mkdir('sandbox/testdir1') os.mkdir('sandbox/testdir2') os.system('touch sandbox/testdir1/file1') os.system('touch sandbox/testdir1/file2') os.system('touch sandbox/testdir1/file3') os.system('touch sandbox/testdir2/file1') os.mkdir('sandbox/seq') os.mkdir('sandbox/emptyDir') for i in range(10):
def test_shouldBeAbleToOverrideSettings(self): os.environ["ARK_MODE"] = "overridetest" arkGlobals = globalSettings() self.assertEqual(arkGlobals.DUMMY_ATTR, "dummy")
import os import sys import time import ctypes import ieInit ieInit.init() import settingsManager globalSettings = settingsManager.globalSettings() errCount = 0 def init(): global errCount errCount = 0 def getCommands(): try: f = open('../test/commands.txt') commands = filter(None, (line.rstrip() for line in f)) f.close() return commands except: print >> sys.stderr, 'Error reading from file.' def getCommandInfo(command): cmd = ' '.join(command.strip().split()[1:]) compTypes = command.split()[0] compTypes = compTypes.split(',') return compTypes, cmd, command
def test_shouldAcceptDotAndGetNotation(self): arkGlobals = globalSettings() self.assertEqual(arkGlobals.ARK_ROOT, arkGlobals.get("ARK_ROOT")) self.assertEqual(arkGlobals.get("ARK_ROOT"), os.environ.get("ARK_ROOT"))
def test_shouldBeAbleToOverrideSettings(self): os.environ["ARK_MODE"] = "overridetest" arkGlobals = globalSettings() self.assertEqual(arkGlobals.NETWORK_TOOLSETS, "networktools")
def test_shouldRetrieveProgrammaticKey(self): arkGlobals = globalSettings() self.assertEqual(arkGlobals.ARK_ROOT, os.environ.get("ARK_ROOT"))
def test_shouldRetrieveSubstitutedString(self): arkGlobals = globalSettings() self.assertEqual( arkGlobals.MANTRA_EXE, "C:/Program Files/Side Effects Software/Houdini 13.0.547/bin/mantra.exe" )
def test_shouldRetrieveLiteralDict(self): arkGlobals = globalSettings() self.assertEqual(arkGlobals.JOB_LIST_TYPE, {"blacklist": 1, "whitelist": 2})
def test_shouldRetrieveLiteralList(self): arkGlobals = globalSettings() self.assertEqual( arkGlobals.ADDITIONAL_TOOLS, ["arkHelpers", "shepherd", "cOS", "translators", "weaver", "settingsManager"] )
def test_shouldRetrieveLiteralString(self): arkGlobals = globalSettings() self.assertEqual(arkGlobals.TEMP, "C:/ie/temp/")