Example #1
0
    def setUp(self):
        self.name = 'TIS dbk22au618.as 2012'
        self.project = workflow.Project('jupiter')
        self.testcamera = camerainterface.Camera()
        self.testcamera.formats = ['RGB Bayer']
        self.testimg = [1,2,3,4]
        self.capture = mock.MagicMock(return_value = self.testimg)
        self.testcamera.capture = self.capture
        createCameraMock = mock.MagicMock(return_value = self.testcamera)

        workflow.createCamera = createCameraMock
Example #2
0
    def test_createCameraConfiguration(self):
        session = workflow.Session()
        project = workflow.Project('jupiter')
        session.currentProject = project
        name = 'tis dbk22au618.as 2012'
        interface = 'tis'
        cameramock = camerainterface.Camera()
        cameraconfigurationmock = workflow.CameraConfiguration(name )
        mockfunc = mock.MagicMock(return_value = cameraconfigurationmock)
        workflow.createCameraConfiguration = mockfunc

        cameraconfiguration = session.createCameraConfiguration(name, interface)

        self.assertIsNotNone(cameraconfiguration)
        self.assertEqual(cameraconfiguration, cameraconfigurationmock)
        mockfunc.assert_called_with(name, interface, session.currentProject)
        self.assertIn(cameraconfiguration, session.workspace.cameraconfigurations)
Example #3
0
 def setUp(self):
     self.dbmock = mock.Mock()
     workflow.getDatabase = mock.Mock(return_value=self.dbmock)
     self.filename = 'jupiter/jupiter3RAWBayer1.fits'
     t = (self.filename,)
     l = [t]
     self.dbmock.getImagesOf = mock.MagicMock(return_value=l)
     self.persistencefacade = workflow.PersistenceFacade()
     fitsmanager = mock.MagicMock()
     fitsmanager.writefits = mock.MagicMock()
     self.persistencefacade.fitsmanager = fitsmanager
     projectname = 'jupiter'
     self.project = workflow.Project(projectname)
     self.testcamera = camerainterface.Camera()
     self.testcamera.formats = ['RGB Bayer']
     self.cameraconfig = workflow.CameraConfiguration('TIS dbk22au618.as 2012', self.testcamera )
     self.cameraconfig.initImageTypes()
     self.project.cameraconfiguration = self.cameraconfig
from astrophoto import camerainterface

filelist = glob.glob("*.db")
for f in filelist:
    os.remove(f)

shutil.rmtree('jupiter')

pf = workflow.PersistenceFacade()

project = workflow.Project('jupiter')
pf.persistproject(project)


camerainterface.getInterfaceNames()
cam = camerainterface.Camera()
cam.formats = ['RGB Bayer']
config = workflow.CameraConfiguration('the imaging source 2012', cam)
config.interface = 'The Imaging Source'
config.initImageTypes()
project.cameraconfiguration = config

pf.persistcameraconfiguration(config, project)

nrOfShots = 3
duration = 3
shotdesc = workflow.createShotdescription(nrOfShots, duration, project, 'RAW Bayer')
pf.persistshotdescription(shotdesc, project)

pf.configdict = {}
pf.projectdict = {}
Example #5
0
 def test_ctor(self):
     testcamera = camerainterface.Camera()
     testcamera.formats = ['RGB Bayer']
     cameraconfig = workflow.CameraConfiguration(self.name, testcamera )
     self.assertIsNotNone(cameraconfig)
     self.assertEqual(cameraconfig.name, self.name)