コード例 #1
0
ファイル: deps.py プロジェクト: paulhendricks/flex
	def test_cross_pipeline_graph(self):
		p = get_pipeline(get_complete_filename('dep_test2'),default_prefix=USE_FILE_PREFIX)

		vl = p.get_visitation_list()
		vl = {x[0].name:x[1] for x in vl}	

		self.assertDictEqual(vl,{'p1_t4':0,'p1_t3':1,'p1_t2':1,'p1_t1':2,'p0_t3':3,'p0_t2':4,'p0_t1':5})
コード例 #2
0
    def test_varexpand1(self):
        """
		This test case checks:

			- basic variable expansion
			- basic pipeline filename expansion
			- nested pipeline filename expansion
		"""
        p = get_pipeline(get_complete_filename('varexpand1'),
                         default_prefix=USE_FILE_PREFIX)
        p.unmark_all_tasks(recur=True)
        p.run()

        # check the output
        self.assertTrue(
            os.path.exists(get_complete_filename('hello_world.txt')))
        self.assertTrue(
            os.path.exists(
                get_complete_filename('varexpand1_pln_expand1.txt')))
        self.assertTrue(
            os.path.exists(get_complete_filename('varexpand1_hello.txt')))
        self.assertTrue(
            os.path.exists(get_complete_filename('varexpand1_pytest.dat')))

        os.remove(get_complete_filename('hello_world.txt'))
        os.remove(get_complete_filename('varexpand1_pln_expand1.txt'))
        os.remove(get_complete_filename('varexpand1_hello.txt'))
        os.remove(get_complete_filename('varexpand1_pytest.dat'))

        p.unmark_all_tasks(recur=True)
コード例 #3
0
ファイル: deps.py プロジェクト: paulhendricks/flex
	def test_within_pipeline_graph(self):
		p = get_pipeline(get_complete_filename('dep_test1'),default_prefix=USE_FILE_PREFIX)

		vl = p.get_visitation_list()
		vl = {x[0].name:x[1] for x in vl}	

		self.assertDictEqual(vl,{'t4':0,'t3':1,'t2':1,'t1':2})
コード例 #4
0
ファイル: deps.py プロジェクト: paulhendricks/flex
    def test_within_pipeline_graph(self):
        p = get_pipeline(get_complete_filename('dep_test1'),
                         default_prefix=USE_FILE_PREFIX)

        vl = p.get_visitation_list()
        vl = {x[0].name: x[1] for x in vl}

        self.assertDictEqual(vl, {'t4': 0, 't3': 1, 't2': 1, 't1': 2})
コード例 #5
0
ファイル: overload.py プロジェクト: paulhendricks/flex
    def test_overload1(self):

        p = get_pipeline(get_complete_filename("overload1"), default_prefix=USE_FILE_PREFIX)
        p.unmark_all_tasks()
        p.run()

        self.assertTrue(os.path.exists(get_complete_filename("overload1_2.txt")))

        os.remove(get_complete_filename("overload1_2.txt"))
コード例 #6
0
    def test_awk1(self):
        p = get_pipeline(get_complete_filename('awk1'),
                         default_prefix=USE_FILE_PREFIX)
        p.unmark_all_tasks()
        p.run()

        fname = get_complete_filename('awk1_out.txt')

        self.assertTrue(os.path.exists(fname))
        os.remove(fname)
コード例 #7
0
ファイル: blocks.py プロジェクト: paulhendricks/flex
	def test_awk1(self):
		p = get_pipeline(get_complete_filename('awk1'),
						default_prefix=USE_FILE_PREFIX)
		p.unmark_all_tasks()
		p.run()

		fname = get_complete_filename('awk1_out.txt')

		self.assertTrue(os.path.exists(fname))
		os.remove(fname)
コード例 #8
0
ファイル: prefix.py プロジェクト: paulhendricks/flex
	def test_spec_dir_prefix(self):
		p = get_pipeline(get_complete_filename('sdir_prefix'),default_prefix=USE_FILE_PREFIX)
		p.unmark_all_tasks(recur=True)
		p.run()

		# check the output
		self.assertTrue(os.path.exists(get_complete_filename(os.path.join('sdir_foo','bar','hello_world.txt'))))

		shutil.rmtree(get_complete_filename('sdir_foo'))

		p.unmark_all_tasks(recur=True)
コード例 #9
0
ファイル: prefix.py プロジェクト: paulhendricks/flex
	def test_spec_file_prefix(self):
		p = get_pipeline(get_complete_filename('sfile_prefix'),default_prefix=USE_FILE_PREFIX)
		p.unmark_all_tasks(recur=True)
		p.run()

		# check the output
		self.assertTrue(os.path.exists(get_complete_filename('sfp_hello_world.txt')))

		os.remove(get_complete_filename('sfp_hello_world.txt'))

		p.unmark_all_tasks(recur=True)
コード例 #10
0
ファイル: overload.py プロジェクト: paulhendricks/flex
    def test_overload1(self):

        p = get_pipeline(get_complete_filename('overload1'),
                         default_prefix=USE_FILE_PREFIX)
        p.unmark_all_tasks()
        p.run()

        self.assertTrue(
            os.path.exists(get_complete_filename('overload1_2.txt')))

        os.remove(get_complete_filename('overload1_2.txt'))
コード例 #11
0
ファイル: blocks.py プロジェクト: paulhendricks/flex
	def test_basic1(self):
		
		p = get_pipeline(get_complete_filename('gpl_basic1'),default_prefix=USE_FILE_PREFIX)
		p.unmark_all_tasks()
		p.run()

		self.assertTrue(os.path.exists(get_complete_filename('gpl_basic1_output1.png')))
		self.assertTrue(os.path.exists(get_complete_filename('output2.png')))

		os.remove(get_complete_filename('gpl_basic1_output1.png'))
		os.remove(get_complete_filename('output2.png'))
コード例 #12
0
    def test_basic1(self):

        p = get_pipeline(get_complete_filename('gpl_basic1'),
                         default_prefix=USE_FILE_PREFIX)
        p.unmark_all_tasks()
        p.run()

        self.assertTrue(
            os.path.exists(get_complete_filename('gpl_basic1_output1.png')))
        self.assertTrue(os.path.exists(get_complete_filename('output2.png')))

        os.remove(get_complete_filename('gpl_basic1_output1.png'))
        os.remove(get_complete_filename('output2.png'))
コード例 #13
0
ファイル: var_expansion.py プロジェクト: paulhendricks/flex
	def test_used_pln_expand1(self):
		"""
		This test and pln_expand2 (the next one) concerns the rather nuanced interpretation of
		using another pipeline. Only those tasks in the used pipeline are invoked that are in
		the dependency chain for the tasks in the present pipeline.
		"""
		p = get_pipeline(get_complete_filename('sdir_prefix2'),default_prefix=USE_FILE_PREFIX)
		p.unmark_all_tasks(recur=True)
		p.run()

		# check the output
		self.assertTrue(os.path.exists(get_complete_filename(os.path.join('sdir_foo2','bar','hello_world.txt'))))

		shutil.rmtree(get_complete_filename('sdir_foo2'))

		p.unmark_all_tasks(recur=True)	
コード例 #14
0
ファイル: deps.py プロジェクト: paulhendricks/flex
    def test_cross_pipeline_graph(self):
        p = get_pipeline(get_complete_filename('dep_test2'),
                         default_prefix=USE_FILE_PREFIX)

        vl = p.get_visitation_list()
        vl = {x[0].name: x[1] for x in vl}

        self.assertDictEqual(
            vl, {
                'p1_t4': 0,
                'p1_t3': 1,
                'p1_t2': 1,
                'p1_t1': 2,
                'p0_t3': 3,
                'p0_t2': 4,
                'p0_t1': 5
            })
コード例 #15
0
    def test_used_pln_expand1(self):
        """
		This test and pln_expand2 (the next one) concerns the rather nuanced interpretation of
		using another pipeline. Only those tasks in the used pipeline are invoked that are in
		the dependency chain for the tasks in the present pipeline.
		"""
        p = get_pipeline(get_complete_filename('sdir_prefix2'),
                         default_prefix=USE_FILE_PREFIX)
        p.unmark_all_tasks(recur=True)
        p.run()

        # check the output
        self.assertTrue(
            os.path.exists(
                get_complete_filename(
                    os.path.join('sdir_foo2', 'bar', 'hello_world.txt'))))

        shutil.rmtree(get_complete_filename('sdir_foo2'))

        p.unmark_all_tasks(recur=True)
コード例 #16
0
ファイル: var_expansion.py プロジェクト: paulhendricks/flex
	def test_varexpand1(self):
		"""
		This test case checks:

			- basic variable expansion
			- basic pipeline filename expansion
			- nested pipeline filename expansion
		"""
		p = get_pipeline(get_complete_filename('varexpand1'),default_prefix=USE_FILE_PREFIX)
		p.unmark_all_tasks(recur=True)
		p.run()

		# check the output
		self.assertTrue(os.path.exists(get_complete_filename('hello_world.txt')))
		self.assertTrue(os.path.exists(get_complete_filename('varexpand1_pln_expand1.txt')))
		self.assertTrue(os.path.exists(get_complete_filename('varexpand1_hello.txt')))
		self.assertTrue(os.path.exists(get_complete_filename('varexpand1_pytest.dat')))

		os.remove(get_complete_filename('hello_world.txt'))
		os.remove(get_complete_filename('varexpand1_pln_expand1.txt'))
		os.remove(get_complete_filename('varexpand1_hello.txt'))
		os.remove(get_complete_filename('varexpand1_pytest.dat'))

		p.unmark_all_tasks(recur=True)