From 828ebb23c5fc75cd141569e9c3b8103d503dd2af Mon Sep 17 00:00:00 2001 From: Leangseu Kim Date: Fri, 15 Sep 2023 16:08:11 -0400 Subject: [PATCH] chore: update test --- openassessment/xblock/test/test_load_static.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/openassessment/xblock/test/test_load_static.py b/openassessment/xblock/test/test_load_static.py index f825a0a01b..42d1e3edf2 100644 --- a/openassessment/xblock/test/test_load_static.py +++ b/openassessment/xblock/test/test_load_static.py @@ -52,16 +52,16 @@ def test_get_url_with_custom_static_url(self): self.assertEqual(LoadStatic.get_url(key_url), urljoin('/cms', 'dist', key_url)) @patch('pkg_resources.resource_string') - def test_is_dev_server_url(self, resource_string): + @patch('json.loads') + def test_is_dev_server_url(self, resource_string, jsondata): resource_string.return_value = None key_url = 'some_url.js' - with patch('json.loads') as jsondata: - jsondata.return_value = { - 'some_url.js': 'some_url.hash.js', - 'is_dev_server': True - } - self.assertEqual(LoadStatic.get_url(key_url), 'some_url.hash.js') - self.assertEqual(LoadStatic.get_is_dev_server(), True) + jsondata.return_value = { + 'some_url.js': 'some_url.hash.js', + 'is_dev_server': True + } + self.assertEqual(LoadStatic.get_url(key_url), 'some_url.hash.js') + self.assertEqual(LoadStatic.get_is_dev_server(), True) @patch('pkg_resources.resource_string') def test_get_url_file_not_found(self, resource_string):