Ejemplo n.º 1
0
    def test_per_channel_ingest_neg_x_extent_offset(self):
        now = datetime.now().strftime("%Y%m%d-%H%M%S%f")

        self.args.experiment = 'test_neg_offset_' + now
        self.args.channel = 'def_files'
        self.args.datatype = 'uint16'
        self.args.x_extent = [-1000, 0]
        self.args.offset_extents = True
        self.args.extension = 'png'
        self.args.channels_list_file = 'tests/channels.test.txt'

        channels = read_channel_names(self.args.channels_list_file)

        # assertions are inside ingest_test_per_channel

        # this is to create resources only:
        self.args.create_resources = True
        self.ingest_test_per_channel(self.args, channels)

        self.args.create_resources = False
        self.ingest_test_per_channel(self.args, channels)

        # cleanup
        for ch in channels:
            ch_args = self.args
            ch_args.channel = ch
            ingest_job = IngestJob(ch_args)
            os.remove(ingest_job.get_log_fname())
            boss_res_params = BossResParams(ingest_job)
            boss_res_params.get_resources(get_only=True)
            boss_res_params.rmt.delete_project(boss_res_params.ch_resource)
        if len(channels) > 0:
            boss_res_params.rmt.delete_project(boss_res_params.exp_resource)
Ejemplo n.º 2
0
    def test_per_channel_ingest(self):
        self.args.datatype = 'uint16'
        self.args.extension = 'tif'
        self.args.channels_list_file = 'tests/channels.test.txt'

        channels = read_channel_names(self.args.channels_list_file)

        # assertions are inside ingest_test_per_channel

        # this is to create resources only:
        # self.ingest_test_per_channel(self.args, channels)

        self.args.create_resources = False
        self.ingest_test_per_channel(self.args, channels)
Ejemplo n.º 3
0
    def test_per_channel_ingest_neg_x_extent_no_offset(self):
        self.args.experiment = 'test_neg_extent_no_offset'
        self.args.channel = 'def_files'
        self.args.x_extent = [-1000, 0]
        self.args.offset_extents = False
        self.args.channels_list_file = 'tests/channels.test.txt'

        channels = read_channel_names(self.args.channels_list_file)

        # assertions are inside ingest_test_per_channel

        # this is to create resources only:
        with pytest.raises(ValueError):
            self.ingest_test_per_channel(self.args, channels)

        self.args.create_resources = False
        with pytest.raises(ValueError):
            self.ingest_test_per_channel(self.args, channels)
Ejemplo n.º 4
0
    def test_read_channel_names_no_channel_file(self):
        channels_path = 'tests/channels.not_found.txt'

        with pytest.raises(FileNotFoundError):
            read_channel_names(channels_path)
Ejemplo n.º 5
0
    def test_read_channel_names(self):
        channels_path = 'tests/channels.test.txt'
        channels = read_channel_names(channels_path)

        valid_channels = ['Channel1', 'Channel0']
        assert valid_channels == channels