1
0
mirror of synced 2026-02-01 13:02:06 -05:00

Add intercom source (#1255)

This commit is contained in:
Sherif A. Nada
2020-12-08 14:42:58 -08:00
committed by GitHub
parent e34f78413a
commit 3ab8c26a6f
27 changed files with 912 additions and 12 deletions

View File

@@ -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))