2022-02-01 15:49:35 +00:00
|
|
|
import os
|
|
|
|
|
2022-01-28 21:11:36 +00:00
|
|
|
from tests.base_test import BaseTest
|
|
|
|
|
2022-02-01 15:49:35 +00:00
|
|
|
from crc import app
|
2022-01-28 21:11:36 +00:00
|
|
|
from crc.services.git_service import GitService
|
|
|
|
|
|
|
|
|
2022-02-01 15:49:35 +00:00
|
|
|
class TestGitService(BaseTest):
|
|
|
|
|
|
|
|
def test_get_repo(self):
|
|
|
|
self.load_example_data()
|
|
|
|
cwd = os.getcwd()
|
|
|
|
sync_file_root = app.config['SYNC_FILE_ROOT']
|
|
|
|
sync_path = os.path.join(cwd, sync_file_root)
|
|
|
|
sync_path = os.path.normpath(sync_path) # removes the dot in sync_path from the join
|
|
|
|
# GitService().init_repo(sync_file_root)
|
|
|
|
repo = GitService().get_repo()
|
|
|
|
# self.assertFalse(repo.bare)
|
|
|
|
self.assertEqual(sync_path, repo.directory)
|
|
|
|
|
|
|
|
print('test_get_repo')
|
2022-01-28 21:11:36 +00:00
|
|
|
|
|
|
|
# def test_push_to_remote(self):
|
|
|
|
# result = GitService().push_to_remote()
|
|
|
|
# print(result)
|
|
|
|
#
|
|
|
|
# def test_pull_from_remote(self):
|
|
|
|
# result = GitService.pull_from_remote()
|
|
|
|
# print(result)
|