def testZipRelativePath(self, mock_zipfile, mock_ziprecursively):
     """Test zipping a relative path."""
     path = '/this/is/a/workspace/loaner/chrome_app'
     name = 'archive'
     mock_archive = mock_zipfile.ZipFile.return_value
     deploy_impl._ZipRelativePath(path, name, path)
     assert mock_zipfile.ZipFile.call_count == 1
     assert mock_ziprecursively.call_count == 1
     assert mock_archive.write.call_count == 0
     assert mock_archive.close.call_count == 1
 def testZipRelativeFile(self, mock_zipfile, mock_ziprecursively):
     """Test zipping a single file."""
     path = '/this/is/a/workspace/loaner/chrome_app'
     name = 'archive'
     full_path = path + '/' + name
     mock_archive = mock_zipfile.ZipFile.return_value
     deploy_impl._ZipRelativePath(full_path, name, path)
     assert mock_zipfile.ZipFile.call_count == 1
     mock_archive.write.assert_called_once_with(full_path)
     assert mock_ziprecursively.call_count == 0
     assert mock_archive.close.call_count == 1