Skip to content

Commit

Permalink
fixed a couple of tests that were failing
Browse files Browse the repository at this point in the history
  • Loading branch information
nahumtimerman committed Jun 5, 2019
1 parent ff5981b commit b6484a8
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ drivers/killPython.bat
package/version.txt
/package/dist/
/package/dist.bat
/local/
4 changes: 2 additions & 2 deletions package/cloudshell/cp/azure/common/helpers/url_helper.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# -*- coding: utf-8 -*-
import httplib2


class URLHelper(object):
def check_url(self, url):
try:
h = httplib2.Http()
resp = h.request(url, 'HEAD')
if int(resp[0]['status']) > 399:
return False
except Exception:
except Exception as e:
print e
return False
return True

Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
from unittest import TestCase

import mock
from azure.mgmt.storage.models import StorageAccountCreateParameters
from mock import MagicMock
from mock import Mock
from msrestazure.azure_operation import AzureOperationPoller
from mock import MagicMock, Mock


from cloudshell.cp.azure.domain.services.storage_service import StorageService
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def test_create_script_extension_for_linux_os(self, operating_system_types):
def test_url_helper(self):
uh = URLHelper()

self.assertTrue(uh.check_url('http://www.stackoverflow.com'))
self.assertTrue(uh.check_url('http://www.google.com'))
self.assertFalse(uh.check_url('https://en.wikipedia.org/wiki/List_of_HTTP_status_codesqqdfdfqqq'))
self.assertFalse(uh.check_url('‪C:\\QsPythonDriverHost.log'))
self.assertFalse(uh.check_url(u'https://gist.github.com/ahmetalpbalkan/b5d4a856fe15464015ae87d5587a4439/raw/466f5c30507c990a4d5a2f5c79f901fa89a80841/hello.shha'))

0 comments on commit b6484a8

Please sign in to comment.