Skip to content

Commit

Permalink
Tweak unit tests
Browse files Browse the repository at this point in the history
Test suite: None
Test baseline: N/A
Test namelist changes: N/A
Test status: N/A

Fixes: None

User interface changes?: No

Code review: None
  • Loading branch information
billsacks committed Aug 10, 2016
1 parent daa2a4b commit 8eab267
Showing 1 changed file with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -217,15 +217,25 @@ def test_setup(self):
# Setup
case1root = os.path.join(self.tempdir, 'case1')
case1 = CaseFake(case1root)
case1.set_value('var_preset', 'preset_value')

# Exercise
mytest = SystemTestsCompareTwoFake(case1)

# Verify
# Make sure that pre-existing values in case1 are copied to case2 (via
# clone)
self.assertEqual('preset_value',
mytest._case2.get_value('var_preset'))

# Make sure that _common_setup is called for both
self.assertEqual('common_val',
mytest._case1.get_value('var_set_in_common_setup'))
self.assertEqual('common_val',
mytest._case2.get_value('var_set_in_common_setup'))

# Make sure that _case_one_setup and _case_two_setup are called
# appropriately
self.assertEqual('case1val',
mytest._case1.get_value('var_set_in_setup'))
self.assertEqual('case2val',
Expand All @@ -243,7 +253,12 @@ def test_setup_case2_exists(self):
mytest = SystemTestsCompareTwoFake(case1,
run_two_suffix = 'test')

# Verify: variables set in various setup methods should not be set
# Verify:

# Make sure that case2 object is set (i.e., that it doesn't remain None)
self.assertEqual('case1.test', mytest._case2.get_value('CASE'))

# Variables set in various setup methods should not be set
# (In the real world - i.e., outside of this unit testing fakery - these
# values would be set when the Case objects are created.)
self.assertIsNone(mytest._case1.get_value('var_set_in_common_setup'))
Expand Down

0 comments on commit 8eab267

Please sign in to comment.