Skip to content

Commit

Permalink
Get functional tests passing on windows
Browse files Browse the repository at this point in the history
The streaming tests added a .files property to the base Params test
class that is used by many other test cases. The history recorder tests
in particular needed control of how the files were then cleaned up to
prevent file connections from preventing their deletion on
windows. Since the cleanup was added to the base class as well this was
now happening in the superclass before all the connections to the file
had been correctly closed in the subclass's tearDown method.

The fix was just to move the files property down to the specific test
subclass that needed it. All the subclasses of this do not need it and
we probably shouldn't modify a heavily used base class for functionality
needed by a very small set of subclasses.
  • Loading branch information
stealthycoin committed Feb 3, 2019
1 parent 0bcd084 commit 5d9f259
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 0 additions & 2 deletions awscli/testutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,15 +363,13 @@ def setUp(self):
self.operations_called = []
self.parsed_responses = None
self.driver = create_clidriver()
self.files = FileCreator()

def tearDown(self):
# This clears all the previous registrations.
self.environ_patch.stop()
if self.make_request_is_patched:
self.make_request_patch.stop()
self.make_request_is_patched = False
self.files.remove_all()

def before_call(self, params, **kwargs):
self._store_params(params)
Expand Down
9 changes: 9 additions & 0 deletions tests/functional/test_streaming_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,19 @@
# language governing permissions and limitations under the License.
from awscli.compat import six
from awscli.testutils import BaseAWSCommandParamsTest
from awscli.testutils import FileCreator


class TestStreamingOutput(BaseAWSCommandParamsTest):

def setUp(self):
super(TestStreamingOutput, self).setUp()
self.files = FileCreator()

def tearDown(self):
super(TestStreamingOutput, self).tearDown()
self.files.remove_all()

def test_get_media_streaming_output(self):
cmdline = (
'kinesis-video-media get-media --stream-name test-stream '
Expand Down

0 comments on commit 5d9f259

Please sign in to comment.