From 8e5fa51bc2c751ab6c97c551ae686b03079d18d3 Mon Sep 17 00:00:00 2001 From: Muhammad Abdullah Waheed Date: Thu, 23 May 2024 20:28:47 +0500 Subject: [PATCH] fix: fixed failing test --- tubular/tests/test_frontend_build.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tubular/tests/test_frontend_build.py b/tubular/tests/test_frontend_build.py index 07603e5e..5ff56cc0 100644 --- a/tubular/tests/test_frontend_build.py +++ b/tubular/tests/test_frontend_build.py @@ -18,12 +18,13 @@ class TestFrontendBuildConfigHandling(TestCase): Cursory tests for frontend config parsing + marshalling. """ + @mock.patch.object(FrontendBuilder, 'get_version_commit_sha', return_value ='') @mock.patch('tubular.scripts.frontend_utils.shutil.copyfile') @mock.patch.object(FrontendBuilder, 'create_version_file') @mock.patch.object(FrontendBuilder, 'build_app') @mock.patch.object(FrontendBuilder, 'install_requirements') def test_frontend_build_config_handling( - self, mock_install, mock_build, mock_create_version, mock_shutil_copyfile + self, mock_install, mock_build, mock_create_version, mock_shutil_copyfile, mock_get_version_commit ): exit_code = None try: @@ -65,8 +66,10 @@ def test_frontend_build_config_handling( "NONE='None'", "NONE_WITH_QUOTES='None'", "JS_CONFIG_FILEPATH='dummy/file/path/env.stage.config.jsx'", + "APP_VERSION=''" ] assert mock_create_version.call_count == 1 assert mock_shutil_copyfile.call_count == 1 + assert mock_get_version_commit.call_count == 1 # Verify that source is correct and destination is rightly formatted mock_shutil_copyfile.assert_called_with('dummy/file/path/env.stage.config.jsx', 'coolfrontend/env.config.jsx')