Add intercom source (#1255)
This commit is contained in:
@@ -22,23 +22,25 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
"""
|
||||
|
||||
import json
|
||||
import pkgutil
|
||||
from typing import List
|
||||
|
||||
from airbyte_protocol import ConfiguredAirbyteCatalog, ConnectorSpecification
|
||||
|
||||
|
||||
class StandardSourceTestIface(object):
|
||||
class StandardSourceTestIface:
|
||||
def __init__(self):
|
||||
pass
|
||||
|
||||
def get_spec(self) -> ConnectorSpecification:
|
||||
raise Exception("Not Implemented")
|
||||
raise NotImplementedError
|
||||
|
||||
def get_config(self) -> object:
|
||||
raise Exception("Not Implemented")
|
||||
raise NotImplementedError
|
||||
|
||||
def get_catalog(self) -> ConfiguredAirbyteCatalog:
|
||||
raise Exception("Not Implemented")
|
||||
raise NotImplementedError
|
||||
|
||||
def get_regex_tests(self) -> List[str]:
|
||||
return []
|
||||
@@ -49,5 +51,22 @@ class StandardSourceTestIface(object):
|
||||
def setup(self) -> None:
|
||||
pass
|
||||
|
||||
def tear_down(self) -> None:
|
||||
def teardown(self) -> None:
|
||||
pass
|
||||
|
||||
|
||||
class DefaultStandardSourceTest(StandardSourceTestIface):
|
||||
SPEC_FILENAME = "spec.json"
|
||||
CONFIG_FILENAME = "config.json"
|
||||
CONFIGURED_CATALOG_FILENAME = "configured_catalog.json"
|
||||
|
||||
def get_spec(self) -> ConnectorSpecification:
|
||||
raw_spec = pkgutil.get_data(self.__class__.__module__.split(".")[0], self.SPEC_FILENAME)
|
||||
return ConnectorSpecification.parse_obj(json.loads(raw_spec))
|
||||
|
||||
def get_config(self) -> object:
|
||||
return json.loads(pkgutil.get_data(self.__class__.__module__.split(".")[0], self.CONFIG_FILENAME))
|
||||
|
||||
def get_catalog(self) -> ConfiguredAirbyteCatalog:
|
||||
raw_catalog = pkgutil.get_data(self.__class__.__module__.split(".")[0], self.CONFIGURED_CATALOG_FILENAME)
|
||||
return ConfiguredAirbyteCatalog.parse_obj(json.loads(raw_catalog))
|
||||
|
||||
Reference in New Issue
Block a user