示例#1
0
    def test_upload_complete(self,mock_rm):
        # dependencies
        removal_service = RemovalService()
        reference = UploadService(removal_service)

        #call upload_complete--> rm()
        reference.upload_complete("my upload file")

        # check that it called the rm() 
        mock_rm.assert_called_with("my upload file")

        # check rm() called 
        removal_service.rm.assert_called_with("my upload file")
示例#2
0
    def test_upload_complete(self):

        # dependencies
        mock_removal_service = mock.create_autospec(RemovalService)
        reference = UploadService(mock_removal_service)

        #call upload_complete--> rm()
        reference.upload_complete("my upload file")

        # check that it called the rm() 
        #mock_rm.assert_called_with("my upload file")

        # check rm() called 
        mock_removal_service.rm.assert_called_with("my upload file")