Skip to content

Commit

Permalink
Adding unit tests and applied gradle formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
apostoltego authored and marcosmarxm committed Aug 1, 2022
1 parent 4e17c55 commit 2308c8c
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 14 deletions.
2 changes: 1 addition & 1 deletion airbyte-integrations/connectors/source-shortio/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ For information about how to use this connector within Airbyte, see [the documen
### Prerequisites
**To iterate on this connector, make sure to complete this prerequisites section.**

#### Minimum Python version required `= 3.7.0`
#### Minimum Python version required `= 3.9.0`

#### Build & Activate Virtual Environment and install dependencies
From this connector directory, create a virtual environment:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"clicks": {
"dt": "2022-07-26 14:03:43.449925"
"dt": "2022-07-27 10:30:43.449925"
}
}
6 changes: 2 additions & 4 deletions airbyte-integrations/connectors/source-shortio/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,10 @@

from setuptools import find_packages, setup

MAIN_REQUIREMENTS = [
"airbyte-cdk~=0.1.56"
]
MAIN_REQUIREMENTS = ["airbyte-cdk~=0.1.56"]

TEST_REQUIREMENTS = [
"pytest~=6.1",
"pytest~=6.2.5",
"source-acceptance-test",
]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
#


import contextlib
import datetime
import json
from abc import ABC
from typing import Any, Iterable, List, Mapping, MutableMapping, Optional, Tuple

import requests
import contextlib
from airbyte_cdk.sources import AbstractSource
from airbyte_cdk.sources.streams import Stream
from airbyte_cdk.sources.streams.http import HttpStream
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#
# Copyright (c) 2022 Airbyte, Inc., all rights reserved.
#

import pytest
from airbyte_cdk.logger import AirbyteLogger
from airbyte_cdk.models import Status
from source_shortio.source import SourceShortio


@pytest.fixture
def config():
return {"domain_id": "foo", "secret_key": "bar", "start_date": "2030-01-01"}


def test_source_shortio_client_wrong_credentials():
source = SourceShortio()
result = source.check(logger=AirbyteLogger, config={"domain_id": "foo", "secret_key": "bar", "start_date": "2030-01-01"})
assert result.status == Status.FAILED


def test_streams():
source = SourceShortio()
config_mock = {"domain_id": "foo", "secret_key": "bar", "start_date": "2030-01-01"}
streams = source.streams(config_mock)
expected_streams_number = 2
assert len(streams) == expected_streams_number

This file was deleted.

0 comments on commit 2308c8c

Please sign in to comment.