Attempt to fix failing grains tests in 2016.3

The tearDown appears to only be removing the grain if it matches a
specific value. This may be leading to the grain value not being blank
at the time the next test is run.

Instead of only deleting the grain if it matches a specific value,
instead delete all items from that grain to ensure that it is empty for
the next test.
This commit is contained in:
Erik Johnson 2017-03-14 11:25:15 -05:00
parent b042484455
commit 5d84b40bfd

View file

@ -142,9 +142,8 @@ class GrainsAppendTestCase(integration.ModuleCase):
GRAIN_VAL = 'my-grain-val'
def tearDown(self):
test_grain = self.run_function('grains.get', [self.GRAIN_KEY])
if test_grain and test_grain == [self.GRAIN_VAL]:
self.run_function('grains.remove', [self.GRAIN_KEY, self.GRAIN_VAL])
for item in self.run_function('grains.get', [self.GRAIN_KEY])
self.run_function('grains.remove', [self.GRAIN_KEY, item])
def test_grains_append(self):
'''