from functools import wraps
import collections
import logging
-from typing import Optional
+try:
+ from typing import Optional
+except ImportError:
+ pass # just for type checking
import requests
from orchestrator import OrchestratorError
import os
import errno
import tempfile
-from typing import List, Any, Optional, Callable, Tuple, TypeVar
-T = TypeVar('T')
+
+try:
+ from typing import List, Optional, Callable
+except ImportError:
+ pass # just for type checking
+
import requests
def deferred(f):
- # type: (Callable[..., T]) -> Callable[..., orchestrator.Completion[T]]
+ # type: (Callable) -> Callable[..., orchestrator.Completion]
"""
Decorator to make RookOrchestrator methods return
a completion object that executes themselves.
from __future__ import absolute_import
import json
-from unittest.mock import MagicMock
+
+try:
+ from unittest.mock import MagicMock
+except ImportError:
+ # py2
+ from mock import MagicMock
import pytest