Skip to content

Commit

Permalink
Add a test for #1219
Browse files Browse the repository at this point in the history
  • Loading branch information
Bo Peng committed Feb 26, 2019
1 parent 755e9be commit 6bcc0cc
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/test_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -1857,6 +1857,24 @@ def testOutputFromWorkflow(self):
self.assertTrue(os.path.isfile('A_1.txt'))
self.assertTrue(os.path.isfile('A_2.txt'))

def testExecyteGlobalSection(self):
'''Global section should be executed only once #1219'''
script = SoS_Script(r'''
[global]
parameter: A=[1, 2]
parameter: B=[]
B.extend(A)
[default]
assert B == [1, 2]
input: for_each=dict(i=range(2))
assert B == [1, 2]
''')
wf = script.workflow()
Base_Executor(wf).run()



if __name__ == '__main__':
#suite = unittest.defaultTestLoader.loadTestsFromTestCase(TestParser)
# unittest.TextTestRunner(, suite).run()
Expand Down

0 comments on commit 6bcc0cc

Please sign in to comment.