From 396f2fd97858fd37f50626699bf6a6535cb3e892 Mon Sep 17 00:00:00 2001 From: Ilya Pavlov Date: Tue, 23 Oct 2018 16:51:04 +0300 Subject: [PATCH] Reproduce error for #152 in test case --- .../configs/git-submodules-without-option.cfg | 6 ++++++ tests/test_project.py | 15 +++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 tests/samples/configs/git-submodules-without-option.cfg diff --git a/tests/samples/configs/git-submodules-without-option.cfg b/tests/samples/configs/git-submodules-without-option.cfg new file mode 100644 index 0000000..ee97f85 --- /dev/null +++ b/tests/samples/configs/git-submodules-without-option.cfg @@ -0,0 +1,6 @@ +[settings] +debug = false +api_key = 1090a6ae-855f-4be7-b8fb-3edbaf1aa3ec + +[git] +other_settings = true \ No newline at end of file diff --git a/tests/test_project.py b/tests/test_project.py index fde4f71..f7d8d3d 100644 --- a/tests/test_project.py +++ b/tests/test_project.py @@ -366,6 +366,21 @@ class ProjectTestCase(TestCase): entity=entity, ) + def test_git_submodule_without_option_submodule_disabled(self): + tempdir = tempfile.mkdtemp() + shutil.copytree('tests/samples/projects/git-with-submodule', os.path.join(tempdir, 'git')) + shutil.move(os.path.join(tempdir, 'git', 'dot_git'), os.path.join(tempdir, 'git', '.git')) + shutil.move(os.path.join(tempdir, 'git', 'asubmodule', 'dot_git'), os.path.join(tempdir, 'git', 'asubmodule', '.git')) + + entity = os.path.join(tempdir, 'git', 'asubmodule', 'emptyfile.txt') + + self.shared( + expected_project='asubmodule', + expected_branch='asubbranch', + entity=entity, + config='git-submodules-without-option.cfg', + ) + def test_git_submodule_detected_and_enabled_globally(self): tempdir = tempfile.mkdtemp() shutil.copytree('tests/samples/projects/git-with-submodule', os.path.join(tempdir, 'git'))