bots: Extract path resolution logic into a function.

This commit is contained in:
Sivagiri Visakan 2018-05-22 01:31:15 +05:30 committed by showell
parent d053528925
commit 09a7894a34
4 changed files with 35 additions and 14 deletions

View file

@ -0,0 +1,15 @@
import os
from unittest import TestCase
from zulip_bots import finder
class FinderTestCase(TestCase):
def test_resolve_bot_path(self) -> None:
current_directory = os.path.dirname(os.path.abspath(__file__))
expected_bot_path = os.path.abspath(current_directory + '/../bots/helloworld/helloworld.py')
expected_bot_name = 'helloworld'
expected_bot_path_and_name = (expected_bot_path, expected_bot_name)
actual_bot_path_and_name = finder.resolve_bot_path('helloworld')
self.assertEqual(expected_bot_path_and_name, actual_bot_path_and_name)