Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test function from external repository can be used in airflow-dags project #226

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions lib/test_funtion_import_from_external_repository.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import subprocess
import unittest


class TestUsingFunctionsFromExternalRepo(unittest.TestCase):
@classmethod
def setUpClass(cls) -> None:
"""Install treetracker functions repository as a package"""
cls.result = subprocess.run(
["pip3", "install", "git+https://github.com/Greenstand/treetracker-functions.git@dev"
"#egg=functions"]
, stdout=subprocess.PIPE)

def test_treetracker_functions_repository_is_successfully_installed(self):
self.assertEqual(self.result.returncode, 0)

def test_hello_function_from_tree_tracker_functions_repository(self):
from functions.refresh_view import hello # noqa
self.assertEqual(hello('Chen'), 'Hello, Chen!')


if __name__ == "__main__":
unittest.main()