Skip to content

Commit

Permalink
chore: update test
Browse files Browse the repository at this point in the history
  • Loading branch information
leangseu-edx committed Sep 15, 2023
1 parent b6df971 commit 828ebb2
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions openassessment/xblock/test/test_load_static.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 828ebb2

Please sign in to comment.