Skip to content
Snippets Groups Projects
Commit bd5183de authored by Nathan Hertz's avatar Nathan Hertz
Browse files

Planned out design. Started laying out class/method structure.

parent cd7af338
No related branches found
No related tags found
No related merge requests found
Showing
with 162 additions and 0 deletions
@ECHO OFF
pushd %~dp0
REM Command file for Sphinx documentation
if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=.
set BUILDDIR=_build
if "%1" == "" goto help
%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.http://sphinx-doc.org/
exit /b 1
)
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end
:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
:end
popd
JOB cat cat.condor
JOB grep grep.condor
PARENT cat CHILD grep
executable = /bin/cp
arguments = /home/casa/capo/nmtest.properties contents.txt
log = condor.log
queue
JOB grep grep2.condor
JOB uniq uniq.condor
PARENT grep CHILD uniq
executable = /bin/grep
arguments = "username contents.txt"
output = usernames.txt
error = grep.err
transfer_input_files = contents.txt
log = condor.log
queue
executable = /bin/grep
arguments = "username nmtest.properties"
should_transfer_files = YES
transfer_input_files = /home/casa/capo/nmtest.properties
output = raw-usernames.txt
error = grep.err
log = condor.log
queue
executable = hello.sh
log = condor.log
queue
#!/bin/sh
echo "Hello, world!"
exit 1
JOB username grep.condor
VARS username search="username" file="/home/casa/capo/nmtest.properties"
JOB password grep.condor
VARS password search="password" file="/home/casa/capo/nmtest.properties"
JOB sort sort.condor
PARENT username password CHILD sort
executable = grep.sh
arguments = "$(search) $(file) $(search).grep-out"
should_transfer_files = YES
transfer_input_files = $(file)
log_file = condor.log
queue
#!/bin/sh
grep $1 $2 > $3
executable = sort.sh
arguments = "combined.txt"
should_transfer_files = YES
transfer_input_files = username.grep-out,password.grep-out
log_file = condor.log
queue
#!/bin/sh
cat *.grep-out | sort > $1
executable = uniq.sh
arguments = raw-usernames.txt
output = unique-usernames.txt
error = uniq.err
log = condor.log
queue
#!/bin/sh
cut -f2 -d= "$1" | sed 's/[ \t]*\([^ \t]*\).*/\1/g' | sort | uniq
#!/usr/bin/env python
from setuptools import setup, find_packages
setup(name='wksp0',
version='1.0rc1',
description='NRAO Archive Workspace Subsystem Prototype 0',
author='Daniel K Lyons',
author_email='dlyons@nrao.edu',
url='https://open-bitbucket.nrao.edu/projects/SSA/repos/wksp0/browse',
packages=find_packages(),
test_suite='tests',
install_requires=[
'injector >= 0.17',
'htcondor >= 8.9',
'pystache >= 0.5'
],
extras_require={
'dev': ['sphinx >= 2.2', 'sphinx_rtd_theme']
},
entry_points={
'console_scripts': [
'run = wksp.run_capability:main',
'run_workflow = wksp.run_workflow:main'
],
})
import unittest
import inspect
from typing import List
import wksp.ifaces
def interface_methods(klass) -> List[str]:
"""
Return the names of methods on the supplied class
:param klass: the class to get methods from
:return: the names of the methods on klass
"""
return [x for (x, _) in inspect.getmembers(klass, predicate=inspect.isfunction)]
class TestInterfaces(unittest.TestCase):
"""
Ensure that the interfaces have exactly the methods we think they have, and no more or less.
"""
def test_capability_info(self):
methods = interface_methods(wksp.ifaces.CapabilityInfo)
self.assertEqual(len(methods), 2, "CapabilityInfo should have two methods")
self.assertIn("lookup_capability", methods, "CapabilityInfo should have a method lookup_capability")
self.assertIn("lookup_capability_request", methods,
"CapabilityInfo should have a method lookup_capability_request")
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment